add project files
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class CoreBehaviour : MonoBehaviour
|
||||
{
|
||||
private CoreDef _coreDef;
|
||||
|
||||
protected CoreDef CoreDef
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_coreDef == null)
|
||||
{
|
||||
CoreDefProvider provider = GetComponentInParent<CoreDefProvider>();
|
||||
if (provider != null)
|
||||
{
|
||||
_coreDef = provider.coreDef;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("CoreBehaviour should be a child of its CoreDefProvider");
|
||||
}
|
||||
}
|
||||
return _coreDef;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user