Example #1
0
        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
        }
Example #2
0
        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());
            }
        }
 public void SearchForPlayer()
 {
     context.SetState(context.GetState_Moving());
 }