void Start() { CheckPointManager.getInstance().onRestart += OnRestart; CheckPointManager.getInstance().onCheckPointChange += OnCheckPointChange; updateState(); existAtLastCheckPoint = CheckPointManager.getInstance().isSceneStart(); }
public void resetScene() { princesse.GetComponent <Animator>().SetBool("IsDead", false); princesse.GetComponent <PrincesseDeplacement>().UnlockPrincesse(); princesse.GetComponent <PrincesseVie>().PlayOneTimeDie = false; for (int i = 1; i < listTransform.Length; i++) { listTransform[i].gameObject.SetActive(false); } CheckPointManager.getInstance().restartCheckPoint(); Cursor.visible = false; }
// Activation du checkPoint public void trigger() { Debug.Log("CheckPoint \" " + gameObject.name + "\" atteint"); this.triggered = true; CheckPointManager.getInstance().OnCheckPointTriggered(); if (onTrigger != null) { onTrigger(); // on notifit de l'activation d'un nouveau checkPoint } }
// Use this for initialization void Start() { sm = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManager>(); sm.setBackgroundMusic(sm.listeClips[NumberMusicSM]); CheckPointManager.getInstance().onRestart += OnRestart; }
void OnDestroy() { CheckPointManager.getInstance().onRestart -= OnRestart; CheckPointManager.getInstance().onCheckPointChange -= OnCheckPointChange; }
void Start() { CheckPointManager.getInstance().onRestart += OnRestart; }