コード例 #1
0
        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();
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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());
        }
コード例 #4
0
ファイル: TankAIController.cs プロジェクト: Xnovae/MobaClient
        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());
        }