fix:1
This commit is contained in:
23
Assets/Scripts/Core/ActionBase.cs
Normal file
23
Assets/Scripts/Core/ActionBase.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
using DG.Tweening;
|
||||
|
||||
public abstract class ActionBase : MonoBehaviour
|
||||
{
|
||||
public abstract void Init();
|
||||
public abstract void RegisterAction();
|
||||
public abstract void RemoveAction();
|
||||
|
||||
public T GetChildComponent<T>(string path) where T : MonoBehaviour
|
||||
{
|
||||
GameObject go = transform.Find(path).gameObject;
|
||||
T t = go.GetComponent<T>();
|
||||
if (t == null)
|
||||
{
|
||||
t = go.AddComponent<T>();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user