// 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; }
void Awake() { //Gets the NavMesh of the object this script is attached to. agent = GetComponent <NavMeshAgent>(); //Finds the player camera script. playerCamera = GameObject.Find("PlayerCamera").GetComponent <PlayerCameraMovement>(); //Gets the line renderer component on game object. line = gameObject.GetComponent <LineRenderer>(); //Sets the character as inactive by default. SetCharacterInactive(); //Grabs animator component. animator = gameObject.GetComponent <Animator>(); }