Example #1
0
 void Start()
 {
     targets     = new List <GameObject>();
     instance    = this;
     originalPos = gameObject.transform.position;
     gun         = GetComponent <S_Gun>();
 }
Example #2
0
 public override void EnterBehaviour(float dt)
 {
     initialPosition = transform.position;
     directions      = new List <Vector3> {
         Vector3.forward, Vector3.back, Vector3.left, Vector3.right
     };
     gun = GetComponent <S_Gun>();
 }
Example #3
0
 public override void EnterBehaviour(float dt)
 {
     initialPosition = transform.position;
     gun             = GetComponent <S_BulletGun>();
     shieldGun       = GetComponent <S_ShieldGun>();
     S_World.events.Add(new Event(
                            gameObject,
                            10,
                            Move,
                            recurrent_: false,
                            variance_: 0));
 }
Example #4
0
 public override void EnterBehaviour(float dt)
 {
     initialPosition = transform.position;
     gun             = GetComponent <S_BulletGun>();
     shieldGun       = GetComponent <S_ShieldGun>();
     S_World.events.Add(new Event(gameObject, 10, Move));
     if (shoot)
     {
         S_World.events.Add(new Event(gameObject, 10, Shoot));
     }
     // Initial direction
     direction = new Vector3(1.0f, 0.0f, 1.0f);
     if (movementType == movementTypes.diagonal)
     {
         direction = Quaternion.AngleAxis(Random.Range(0, 4) * 90f, Vector3.up) * direction;
     }
     else
     {
         direction = Quaternion.AngleAxis(Random.Range(0f, 360f), Vector3.up) * direction;
     }
     direction = direction.normalized;
     // Direction movement
     S_World.events.Add(new Event(gameObject, movementDirectionRefreshTicks, RefreshDirection));
 }