protected virtual void Awake() { render = GetComponent <MeshRenderer>(); if (render == null) { render = GetComponentInChildren <MeshRenderer>(); } if (render != null) { meshFilter = render.GetComponent <MeshFilter>(); originMaterial = render.sharedMaterial; } elementComponent = GetComponent <CElementComponent>(); }
virtual protected void Awake() { //注册事件 GameManager.instance.eRoundStart.AddListener(OnRoundStart); GameManager.instance.eRoundEnd.AddListener(OnRoundEnd); GameManager.instance.eGameStart.AddListener(OnGameStart); GameManager.instance.eGameEnd.AddListener(OnGameEnd); render = GetComponent <MeshRenderer>(); if (render == null) { render = GetComponentInChildren <MeshRenderer>(); } meshFilter = render.GetComponent <MeshFilter>(); elementComponent = GetComponent <CElementComponent>(); originMaterial = render.material; }
public virtual void Init(GActor owner, CElementComponent stateMachine) { this.owner = owner; this.stateMachine = stateMachine; }