// ********************************************************************** // PRIVATE METHODS / COROUTINES // ********************************************************************** /* * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ * SUMMARY: GiveUserControlOfEnemy, GiveUserControlOfPlayer * These functions enable the UserController for either the player * or the enemy (this object). * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ */ private void GiveUserControlOfEnemy(Spirit spirit) { // Set enemy as entity for player cameras to follow SetEntityForPlayerCameraToFollow(transform); // Destroy the spirit game object and play sounds/animation player = spirit.GetPlayerReference(); spirit.GiveUpControlToEntity(this); // Set the enemy as the entity to control _controllerState.entityToControl = this; _controllerState.cursorEnable = true; _controllerState.inputEn.all = true; }