// Use this for initialization. void Start() { playerCamera = GameObject.Find("PlayerCamera").GetComponent <PlayerCameraMovement>(); currentTurn = TurnOwner.Player; //Get list of playable characters. if (pcList == null) { UpdatePCList(); } currentPCIndex = 0; currentPC = pcList[0]; //Sets the first PC to active state. moveScript = currentPC.GetComponent <MoveToClickPoint>(); moveScript.SetCharacterActive(); //Grabs all the enemy units on the level. if (enemyList == null) { UpdateEnemyList(); } currentEnemyIndex = 0; currentEnemy = enemyList[currentEnemyIndex]; // Set booleans to default values. currentEnemyDone = true; turnOver = false; }
//Function to select next PC. public void SelectNextPC() { moveScript = currentPC.GetComponent <MoveToClickPoint>(); moveScript.SetCharacterInactive(); currentPCIndex++; if (currentPCIndex == pcList.Length) { currentPCIndex = 0; } currentPC = pcList[currentPCIndex]; playerCharTemp = currentPC.GetComponent <CharacterTemplate>(); while (playerCharTemp.isDead == true) { // ** BUG ** DEAD GUY STILL GETS SELECTED; // ** NEED TO CHECK LOSE CONDITION HERE ** currentPCIndex++; if (currentPCIndex == pcList.Length) { currentPCIndex = 0; } currentPC = pcList[currentPCIndex]; playerCharTemp = currentPC.GetComponent <CharacterTemplate>(); } moveScript = currentPC.GetComponent <MoveToClickPoint>(); moveScript.SetCharacterActive(); playerCamera.currentPCIndex = currentPCIndex; playerCamera.currentPC = currentPC; }
//Function to select next PC. public void SelectNextPC() { moveScript = currentPC.GetComponent <MoveToClickPoint>(); moveScript.SetCharacterInactive(); currentPCIndex++; if (currentPCIndex == pcList.Length) { currentPCIndex = 0; } currentPC = pcList[currentPCIndex]; moveScript = currentPC.GetComponent <MoveToClickPoint>(); moveScript.SetCharacterActive(); playerCamera.currentPCIndex = currentPCIndex; playerCamera.currentPC = currentPC; }
//Function to switch to player turn. public void StartPlayerTurn() { //Sets current turn to player currentTurn = TurnOwner.Player; //Updates bool in Player Camera to true. playerCamera.IsPlayerTurn = true; //Sets the current character to first character. // ** NEED TO CHANGE THIS TO CHECK FOR ALIVE CHARACTERS ONCE STAT SHEET IS DONE. currentPCIndex = 0; currentPC = pcList[0]; //Sets the first PC to active state. moveScript = currentPC.GetComponent <MoveToClickPoint>(); moveScript.SetCharacterActive(); //Function in player camera to snap to first index character. playerCamera.StartNewTurn(); }
//Function to switch to player turn. public void StartPlayerTurn() { //Sets current turn to player currentTurn = TurnOwner.Player; //Updates bool in Player Camera to true. playerCamera.IsPlayerTurn = true; //Sets the current character to first character. // ** NEED TO CHANGE THIS TO CHECK FOR ALIVE CHARACTERS ONCE STAT SHEET IS DONE. currentPCIndex = 0; currentPC = pcList[0]; // Checks for death state. playerCharTemp = currentPC.GetComponent <CharacterTemplate>(); while (playerCharTemp.isDead == true) { // ** BUG ** DEAD GUY STILL GETS SELECTED; // ** NEED TO CHECK LOSE CONDITION HERE ** currentPCIndex++; if (currentPCIndex == pcList.Length) { currentPCIndex = 0; } currentPC = pcList[currentPCIndex]; playerCharTemp = currentPC.GetComponent <CharacterTemplate>(); } //Sets the first PC to active state. moveScript = currentPC.GetComponent <MoveToClickPoint>(); moveScript.SetCharacterActive(); //Function in player camera to snap to first index character. playerCamera.StartNewTurn(); }
// Start is called before the first frame update void Start() { movement = GetComponent <MoveToClickPoint>(); statsScript = GetComponent <Stats>(); }