private void Awake() { if (!_instance) { _instance = this; } else { Debug.LogError("More than 1 CubeManagers in the scene"); Destroy(this.gameObject); } }
private void Awake() { if (!_instance) { _instance = this; ManomotionManager.OnManoMotionFrameProcessed += HandleManoMotionFrameProcessed; } else { Debug.LogError("More than 1 CubeManagers in the scene"); Destroy(this.gameObject); } }
public void TakeDamage(int amount) { mCurrentHealth -= amount; if (onHealthChange != null) { onHealthChange(mCurrentHealth); } if (mCurrentHealth <= 0) { CubeGameManager.Restart(); } }
void Start() { instance = this; }
IEnumerator ReiniciaJuego() { yield return(new WaitForSeconds(0.9f)); CubeGameManager.Restart(); }