void Start() { //base.Start(); // get component anim = GetComponent<EnemyAnimation>(); if (anim == null) { Debug.LogError("Error On Finding Internal EnemyAnimation Script"); Application.Quit(); } // add aura GameObject aura_object = (GameObject)Instantiate(Resources.Load("Prefabs/EnemyAura"), transform.position, new Quaternion()); aura = aura_object.GetComponent<EnemyAttackAura>(); aura.SetOwner(this); }
// this should be called before its sibling public virtual void Start() { // initialize state machine unit_state = new StateMachine<unit_states>(); unit_state.AddState(unit_states.none, () => { }); unit_state.AddState(unit_states.act, UnitStateAct); unit_state.AddState(unit_states.actpause, UnitStateActPause); unit_state.SetInitState(unit_states.act); // add aura GameObject aura_object = (GameObject)Instantiate(Resources.Load("Prefabs/EnemyAura"), transform.position, new Quaternion()); aura = aura_object.GetComponent<EnemyAttackAura>(); aura.SetOwner(this); }