private void OnRuntimeDestroy() { if (m_instance == this) { m_instance = null; } }
private void RuntimeAwake() { if (m_instance != null) { Debug.LogWarning("Another instance of Cubemen game exist"); Destroy(m_instance); return; } m_instance = this; }
private void Start() { m_soul = transform.Find("Soul"); m_skinnedMeshRenderer = GetComponentInChildren <SkinnedMeshRenderer>(); m_rigidBody = GetComponent <Rigidbody>(); if (Game == null) { Game = FindObjectOfType <CubemenGame>(); } }
private void OnDestroy() { if (m_instance == this) { m_instance = null; } if (BtnReplay != null) { BtnReplay.onClick.RemoveListener(RestartGame); } }