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.
44 lines
1.2 KiB
44 lines
1.2 KiB
4 years ago
|
using AX.InputSystem;
|
||
|
using AX.MessageSystem;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
/// <summary>
|
||
|
/// 克隆物体对象操作基类
|
||
|
/// </summary>
|
||
|
public abstract class CloneBase : MonoBehaviour
|
||
|
{
|
||
|
|
||
|
public GameObject clonePrefab;//绑定的预制体
|
||
|
public CloneObjType cloneObjType;//克隆类型
|
||
|
protected int number = 0;//计数
|
||
|
public string ResourcesName;
|
||
|
[HideInInspector]
|
||
|
public GameObject cloneObj;//克隆出的物体
|
||
|
public virtual void Awake()
|
||
|
{
|
||
|
if (clonePrefab==null)
|
||
|
{
|
||
|
clonePrefab = Resources.Load(ResourcesName) as GameObject;
|
||
|
}
|
||
|
}
|
||
|
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);
|
||
|
public abstract void AddRecordFrame(List<ObjectData> list);
|
||
|
public abstract void AddRecordEventClone(Transform obj);
|
||
|
public abstract void AddRecordTag(List<ObjectData> list);
|
||
|
}
|