void Awake() { if (s_instance != null) { Destroy(this); } s_instance = this; DontDestroyOnLoad(this); }
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { if (arg0.name.Contains("Stage")) { pumpkin = ModAssets.Instantiate <GameObject>("Pumpkin_pre"); object_left = ModAssets.Instantiate <GameObject>("Cube_pre"); object_right = ModAssets.Instantiate <GameObject>("Cube_pre"); } else { PumpkinScript.DestroyPumpkinScript(); UnityEngine.Object.Destroy(pumpkin); pumpkin = null; } }
public void OnGameStageUnloaded() { PumpkinScript.DestroyPumpkinScript(); UnityEngine.Object.Destroy(pumpkin); pumpkin = null; }