コード例 #1
0
ファイル: State_ShotFired.cs プロジェクト: jbryant32/JDA
        public void ShotFired()
        {
            clip++;
            clip = Mathf.Clamp(clip, 0, _Bullets.Count - 1);

            if (clip == _Bullets.Count - 1)//out of bullets
            {
                context.SetState(context.GetState_Moving());
            }



            _Bullets[clip].Initiliaze(this.transform.position, this.gameObject, 3);//fire shot


            context.SetState(context.GetState_Moving());//exit to state moving
        }
コード例 #2
0
ファイル: State_Firing.cs プロジェクト: jbryant32/JDA
        public void AttackingPlayer()
        {
            lerpt       += 0.05f;
            AttackTimer += Time.fixedDeltaTime * 1;
            state_moving.GetVecotrPoints();
            if (lerpt < 1)
            {
                // FlyingBotPhysics.RotateTo(me, Player.transform.position, lerpt);
            }

            if (lerpt >= 1)
            {
                LaserRife.FireLaser();
            }
            if (AttackTimer > 8)
            {
                lerpt       = 0;
                AttackTimer = 0;
                context.SetState(context.GetState_Moving());
            }
        }
コード例 #3
0
 public void SearchForPlayer()
 {
     context.SetState(context.GetState_Moving());
 }