public void load() { gameManager.gameObject.GetComponent <spawnMeALilStack>().prevent = true; foreach (GameObject child in childs) { if (child != null) { child.GetComponent <AnimHandler>().activeElt(true); } } foreach (GameObject mechanism in mechanisms) { triggerPlateform tr_t = mechanism.GetComponent <triggerPlateform>(); movingBehaviour mv_t = mechanism.GetComponent <movingBehaviour>(); if (tr_t) { tr_t.restore(); } if (mv_t) { mv_t.restore(); } } foreach (GameObject obj in GameObject.FindGameObjectsWithTag("graines")) { DestroyImmediate(obj); } if (!gameManager.inMenu) { gameManager.gameObject.GetComponent <spawnMeALilStack>().SetUp(seedCountInfinite, seedCount); } gameManager.gameObject.GetComponent <spawnMeALilStack>().prevent = false; }
public void restore() { gameManager.gameObject.GetComponent <spawnMeALilStack>().prevent = true; GameObject.Find("poule").GetComponent <PouleManager>().restore(); foreach (GameObject mechanism in mechanisms) { triggerPlateform tr_t = mechanism.GetComponent <triggerPlateform>(); movingBehaviour mv_t = mechanism.GetComponent <movingBehaviour>(); if (tr_t) { tr_t.restore(); } if (mv_t) { mv_t.restore(); } } foreach (GameObject obj in GameObject.FindGameObjectsWithTag("graines")) { DestroyImmediate(obj); } gameManager.gameObject.GetComponent <spawnMeALilStack>().SetUp(seedCountInfinite, seedCount); GameObject.Find("poule").transform.position = startPos.transform.position; gameManager.gameObject.GetComponent <spawnMeALilStack>().prevent = false; }