/// <summary> /// Called from the yes button of the "next floor" scene /// </summary> public void PrepareNextFloorInstigation() { // Get the persistant controller script PersistantController persistContScript = FindPersistCont(); // Prepare the next floor persistContScript.PrepareNextFloor(); }
/// <summary> /// Finds the Persistant controller and calls PrepareNextFloor /// </summary> public void PrepareNextFloor() { try { GameObject persistObj = GameObject.FindWithTag("PersistantController"); PersistantController persistRef = persistObj.GetComponent <PersistantController>(); persistRef.PrepareNextFloor(); } catch { Debug.LogError("Failed to Prepare Next Floor"); } }