public void activatePlayer() { UpperHandle upperHandle = GameObject.Find("Panto").GetComponent <UpperHandle>(); StartCoroutine(upperHandle.SwitchTo(gameObject, 0.2f)); upperHandle.FreeRotation(); }
/// <summary> /// Starts a new round. /// </summary> /// <returns></returns> async Task ResetGame() { await _speechOut.Speak("Spawning player"); player.transform.position = playerSpawn.position; await _upperHandle.SwitchTo(player, 0.2f); await _speechOut.Speak("Spawning enemy"); enemy.transform.position = enemySpawn.position; enemy.transform.rotation = enemySpawn.rotation; await _lowerHandle.SwitchTo(enemy, 0.2f); if (level >= enemyConfigs.Length) { Debug.LogError($"Level {level} is over number of enemies {enemyConfigs.Length}"); } enemy.GetComponent <EnemyLogic>().config = enemyConfigs[level]; _upperHandle.Free(); player.SetActive(true); enemy.SetActive(true); _levelStartTime = Time.time; }