You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
602 B
26 lines
602 B
4 years ago
|
using AX.MessageSystem;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public abstract class CloneBase : MonoBehaviour {
|
||
|
|
||
|
public GameObject clonePrefab;//绑定的预制体
|
||
|
public CloneObjType cloneObjType;//克隆类型
|
||
|
|
||
|
public virtual void OnEnable()
|
||
|
{
|
||
|
MessageDispatcher.AddListener("CLONE_COMMAND", Execute);
|
||
|
}
|
||
|
|
||
|
public virtual void OnDisable()
|
||
|
{
|
||
|
MessageDispatcher.RemoveListener("CLONE_COMMAND", Execute);
|
||
|
}
|
||
|
|
||
|
public virtual void OnDestroy()
|
||
|
{
|
||
|
MessageDispatcher.RemoveListener("CLONE_COMMAND", Execute);
|
||
|
}
|
||
|
|
||
|
public abstract void Execute(IMessage obj);
|
||
|
}
|