WaiXie_QuestionSystem/Assets/Script/Process/ProcessBase.cs

57 lines
1.1 KiB
C#
Raw Normal View History

2023-12-10 12:28:20 +08:00
using System;
using UnityEngine;
using ZXL.ID;
namespace Script.UI.Process
{
public abstract class ProcessBase : MonoBehaviour, IProcess
{
[SerializeField] private int _id;
[SerializeField] private ProcessType _processType;
public int ID => _id;
public ProcessType processType => _processType;
private void Awake()
{
Init();
gameObject.SetActive(false);
}
private void OnDestroy()
{
Dispose();
}
// private void OnEnable()
// {
// Enter();
// }
//
// private void OnDisable()
// {
// Exit();
// }
public virtual void Enter()
{
gameObject.SetActive(true);
Debug.Log($"start process : {_processType}");
}
public virtual void Exit()
{
gameObject.SetActive(false);
Debug.Log($"stop process : {_processType}");
}
public virtual void Init()
{
}
public virtual void Dispose()
{
}
}
}