void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); this.gameObject.name = gameObject.name + " Instance"; } else { Destroy(this.gameObject); return; } #if UNITY_5_4_OR_NEWER SceneManager.sceneLoaded += OnLevelFinishedLoading; #endif var player = GameObject.FindObjectOfType <vThirdPersonController>(); if (player) { currentPlayer = player.gameObject; currentController = player; player.onDead.AddListener(OnCharacterDead); } else if (currentPlayer == null && playerPrefab != null && spawnPoint != null) { Spawn(spawnPoint); } }
protected virtual void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); this.gameObject.name = gameObject.name + " Instance"; } else { Destroy(this.gameObject); return; } SceneManager.sceneLoaded += OnLevelFinishedLoading; if (displayInfoInFadeText && vHUDController.instance) { vHUDController.instance.ShowText("Init Scene"); } FindPlayer(); Time.timeScale = 1; Debug.Log("current" + currentPlayer.transform.position); Debug.Log("goal" + goalPoint.transform.position); }
void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); this.gameObject.name = gameObject.name + " Instance"; } else { //Destroy(this.gameObject); return; } SceneManager.sceneLoaded += OnLevelFinishedLoading; if (displayInfoInFadeText && vHUDController.instance) { vHUDController.instance.ShowText("Init Scene"); } FindPlayer(); }
private void Start() { gm = FindObjectOfType <vGameController>(); }