private void SpawnGame() { Singleton <SlowmoManager> .Instance.ResetTime(); mainCamera.transform.position = new Vector3(0, 0, -10); mainGameInstance = Instantiate(mainGame); mainCamera.transform.parent = mainGameInstance.transform; VoiceMovement voiceMovement = mainGameInstance.GetComponentInChildren <VoiceMovement>(); voiceMovement.RegisterDeathListener(PlayerDeath); }
/* [Header("PlayerInfo")] * public int Playerlives = 3; */ /* private void Awake() //Appliying Singleton for future Use * { * int numGameSessions = FindObjectsOfType<GameSession>().Length; * if(numGameSessions > 1) * { * Destroy(this.gameObject); * } * else * { * DontDestroyOnLoad(this.gameObject); * } * } */ void Start() { voicetotext = FindObjectOfType <VoiceToText>(); voiceScript = FindObjectOfType <VoiceMovement>(); keyboardscript = FindObjectOfType <PlayerMovementRB>(); LoseLabel.SetActive(false); InstructionsLabel.SetActive(true); ScoreLabel.SetActive(false); VoicetoTextLabel.SetActive(true); keyboardscript.enabled = true; }
// Start is called before the first frame update void Start() { player = FindObjectOfType <VoiceMovement>().GetComponent <VoiceMovement>(); actions.Add(command, WalkTo); playerAt = false; keyWordRec = new KeywordRecognizer(actions.Keys.ToArray()); keyWordRec.OnPhraseRecognized += RecognisedSpeech; keyWordRec.Start(); }