void Awake() { attribute = GetComponent <NpcAttribute>(); ai = new TankCharacter(); ai.attribute = attribute; ai.AddState(new HumanIdle()); //ai.AddState(new TankMoveAndShoot()); ai.AddState(new TankSkill()); //ai.AddState(new HumanMove()); //ai.AddState(new HumanCombat()); //ai.AddState(new HumanSkill()); ai.AddState(new HumanDead()); ai.AddState(new MonsterKnockBack()); ai.AddState(new HumanStunned()); ai.AddState(new HumanJump()); this.regEvt = new List <MyEvent.EventType>() { MyEvent.EventType.EnterSafePoint, MyEvent.EventType.ExitSafePoint, }; RegEvent(); }
void Awake() { attribute = GetComponent <NpcAttribute>(); var tower = Util.FindChildRecursive(transform, "tower"); tower.gameObject.AddComponent <TowerAutoCheck>(); ai = new TankCharacter(); ai.attribute = attribute; ai.AddState(new TankIdle()); ai.AddState(new TankMoveAndShoot()); ai.AddState(new TankDead()); ai.AddState(new TankKnockBack()); ai.AddState(new HumanStunned()); ai.AddState(new TankStop()); }
void Awake() { //var bx = Util.FindChildRecursive(transform, "boxColldier"); //var bx1 = Util.FindChildRecursive(transform, "boxColldier2"); //Physics.IgnoreCollision(bx.collider, bx1.collider); var tower = Util.FindChildRecursive(transform, "tower"); tower.gameObject.AddComponent <TowerAutoCheck>(); attribute = GetComponent <NpcAttribute>(); ai = new TankCharacter(); ai.attribute = attribute; ai.AddState(new TankIdle()); ai.AddState(new TankMoveAndShoot()); ai.AddState(new TankDead()); ai.AddState(new TankKnockBack()); ai.AddState(new HumanStunned()); ai.AddState(new TankStop()); }
private void Awake() { var tower = Util.FindChildRecursive(transform, "tower"); tower.gameObject.AddComponent <TowerAutoCheck>(); attribute = GetComponent <NpcAttribute>(); ai = new TankCharacter(); ai.attribute = attribute; ai.AddState(new TankIdle()); ai.AddState(new TankMoveAndShoot()); ai.AddState(new TankDead()); ai.AddState(new TankKnockBack()); ai.AddState(new HumanStunned()); ai.AddState(new TankStop()); run = BackgroundSound.Instance.PlayEffectLoop("run", 0.1f); run.Play(); StartCoroutine(CheckSpeed()); StartCoroutine(CheckHP()); }