private void OnDestroy() { if (Instance == this) { Instance = null; } }
public void SetUpEssentialGameObjects() { Player = Instantiate(playerPrefab); MainCamera = Instantiate(mainCameraPrefab); Canvas = Instantiate(canvasPrefab); camScript = MainCamera.GetComponent <Camera>(); canvasController = Canvas.GetComponent <UICanvasController>(); }
// Use this for initialization void Start() { _instance = this; Hope.maxValue = GameSettingsManager.LevelStartingHope; Hope.value = GameSettingsManager.LevelStartingHope; Horror.maxValue = GameSettingsManager.LevelMaxHorror; Horror.value = 0; GiftsDeliveredTextObject.text = "0/15"; CurrentGiftsTextObject.text = "0"; }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); return; } }
//Get All UICanvas ,when Forbiddle UI this Will Be Use public void RegistCanvas(UICanvasController canvas, bool isRegist) { if (isRegist) { if (m_AllCanvas.Contains(canvas)) { return; // Debug.Log("�ظ�ע��" + canvas); } m_AllCanvas.Add(canvas); return; }//if if (m_AllCanvas.Contains(canvas)) { m_AllCanvas.Remove(canvas); } }