// Use this for initialization void Awake() { playerLives = 3; Time.timeScale = 1; restartTimer = Time.time + 5.5f; hud = GameObject.FindObjectOfType <PlayerHUD>(); player = GameObject.FindObjectOfType <PlayerMan>(); stopWatch = GameObject.FindObjectOfType <StopWatchManager>(); timeSubmit = GameObject.FindObjectOfType <TimeSaveController>(); if (playerName == null) { playerName = "tester"; } //Debug.Log("Game Manager Loaded"); //InputMap jump = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("jumpKey", "Space")); attack = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("attackKey", "F")); left = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("leftKey", "A")); right = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("rightKey", "D")); setIce = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("iceKey", "Alpha3")); setFire = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("fireKey", "Alpha2")); setArcane = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("arcaneKey", "Alpha1")); pause = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("pauseKey", "Escape")); }
void Update() { if (hud == null) { hud = GameObject.FindObjectOfType <PlayerHUD>(); Debug.Log(hud); } if (player == null) { player = GameObject.FindObjectOfType <PlayerMan>(); } if (timeSubmit == null) { timeSubmit = GameObject.FindObjectOfType <TimeSaveController>(); } timeSaved = stopWatch.time; //Debug.Log(timeSaved); }