public override void Exit(Agent agent) { Debug.Log("Exiting Sleep State."); }
public override void Enter(Agent agent) { Debug.Log("Entering Sleep State."); }
public override void Execute(Agent agent) { agent.sleep(); }
public virtual void Enter(Agent agent) { }
public virtual void Exit(Agent agent) { }
public virtual void Execute(Agent agent) { }
void SpawnPlayers() { for (int i = 0; i < numPlayers; i++) { playerStatus[i] = players[i].GetComponent <PlayerInfo>(); // Reference to playerInfo script playerStatus[i].body = Instantiate(players[i], playerStatus[i].spawnPoint, Quaternion.identity) as GameObject; playerStatus[i] = playerStatus[i].body.GetComponent <PlayerInfo>(); playerStatus[i].body = players[i].gameObject; playerStatus[i].id = i + 1; } // For 2 players set up start information this way if (numPlayers == 2) { playerStatus[0].transform.position = playerStatus[0].spawnPoint; playerStatus[0].x = 8; playerStatus[0].y = 4; playerStatus[0].goalX = 0; playerStatus[0].goalY = -1; boardStatus[8, 4].isOpen = false; if (MainMenu.playerSettings == 2) // If EvE was selected make 1st player a Bot { playerStatus[0].isAi = true; MyAgent = new Assets.Scripts.Agent(); } playerStatus[1].transform.position = playerStatus[1].spawnPoint; playerStatus[1].x = 0; playerStatus[1].y = 4; playerStatus[1].goalX = 8; playerStatus[1].goalY = -1; boardStatus[0, 4].isOpen = false; if (MainMenu.playerSettings == 1 || MainMenu.playerSettings == 2) // If PvE or EvE was selected make 2nd player a Bot { playerStatus[1].isAi = true; MyAgent = new Assets.Scripts.Agent(); } } // For 4 players set up start information this way else if (numPlayers == 4) { playerStatus[0].transform.position = playerStatus[0].spawnPoint; playerStatus[0].x = 8; playerStatus[0].y = 4; playerStatus[0].goalX = 0; playerStatus[0].goalY = -1; boardStatus[8, 4].isOpen = false; playerStatus[1].transform.position = playerStatus[1].spawnPoint; playerStatus[1].x = 0; playerStatus[1].y = 4; playerStatus[1].goalX = 8; playerStatus[1].goalY = -1; boardStatus[0, 4].isOpen = false; playerStatus[2].transform.position = playerStatus[2].spawnPoint; playerStatus[2].x = 4; playerStatus[2].y = 8; playerStatus[2].goalX = -1; playerStatus[2].goalY = 0; boardStatus[4, 8].isOpen = false; playerStatus[3].transform.position = playerStatus[3].spawnPoint; playerStatus[3].x = 4; playerStatus[3].y = 0; playerStatus[3].goalX = -1; playerStatus[3].goalY = 8; boardStatus[4, 0].isOpen = false; } }
public abstract void Execute(Agent agent);