25 lines
602 B
25 lines
602 B
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); |
|
}
|
|
|