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)); }
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)); }