public override void ChooseAction(World world) { if (BoardMetadata.Random.Next(0, 10) == 0) { switch (BoardMetadata.Random.Next(0, 3)) { case 0: Command = null; break; case 1: Command = new BackToQueenCommand(); break; case 2: Command = new IdleCommand(); break; } NotifyAll(); } ActionStrategy = EggsProduceStrategy.Instance; }
// Use this for initialization void Start() { t = transform; _walkableTerrain = new string[] { "Terrain", "ActiveEnemy","HitBox" }; _currentState = PlayerState.IDLE; _idleCommand = gameObject.AddComponent<IdleCommand>(); _moveCommand = gameObject.AddComponent<MoveCommand>(); _moveAttackCommand = gameObject.AddComponent<MoveAttackCommand>(); _moveToLevelCommand = gameObject.AddComponent<MoveToAnotherLevelCommand>(); _currentCommand = _idleCommand; _dashingTrail.enabled = false; _weaponTrail.Deactivate(); FlushPreviousCommand(); }