private void OnDestroy()
    {
        if (_instance != this)
        {
            return;
        }

        _instance = null;
        Resources.UnloadUnusedAssets();
    }
 private void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     // 인스턴스가 존재하는 경우 새로생기는 인스턴스를 삭제한다.
     else if (_instance != this)
     {
         Destroy(gameObject);
     }
     // 아래의 함수를 사용하여 씬이 전환되더라도 선언되었던 인스턴스가 파괴되지 않는다.
     DontDestroyOnLoad(gameObject);
 }
Exemplo n.º 3
0
    public void MoveToScene(INTERACTION _scenename)
    {
        string scene = _scenename.ToString();

        isOption       = false;
        Time.timeScale = 1;

        if (_scenename == INTERACTION.DUNGEON || _scenename == INTERACTION.LOBBY)
        {
            LoadingSceneController.LoadScene(scene);
        }
        else
        {
            SceneManager.LoadScene(scene);
        }
    }
Exemplo n.º 4
0
    private IEnumerator FlyButton()
    {
        ControllerEventHandler.PauseEvents();
        ScreenFader.FadeOut(Color.black, 0.85f);
        yield return(new WaitForSeconds(1f));

        if (PilotSaveManager.currentScenario.equipConfigurable)
        {
            LoadingSceneController.LoadSceneImmediate("VehicleConfiguration");
        }
        else
        {
            BGMManager.FadeOut(2f);
            Loadout loadout = new Loadout();
            loadout.normalizedFuel = PilotSaveManager.currentScenario.forcedFuel;
            loadout.hpLoadout      = new string[PilotSaveManager.currentVehicle.hardpointCount];
            loadout.cmLoadout      = new int[]
            {
                99999,
                99999
            };
            if (PilotSaveManager.currentScenario.forcedEquips != null)
            {
                foreach (CampaignScenario.ForcedEquip forcedEquip in PilotSaveManager.currentScenario.forcedEquips)
                {
                    loadout.hpLoadout[forcedEquip.hardpointIdx] = forcedEquip.weaponName;
                }
            }
            VehicleEquipper.loadout = loadout;
            if (PilotSaveManager.currentCampaign.isCustomScenarios)
            {
                VTScenario.LaunchScenario(VTResources.GetScenario(PilotSaveManager.currentScenario.scenarioID, PilotSaveManager.currentCampaign), false);
            }
            else
            {
                LoadingSceneController.LoadScene(PilotSaveManager.currentScenario.mapSceneName);
            }
        }
        ControllerEventHandler.UnpauseEvents();
    }
Exemplo n.º 5
0
 private void LoadRequestedScenee()
 {
     loadingSC = new LoadingSceneController();
 }
Exemplo n.º 6
0
 public void homeBtnTapped()
 {
     LoadingSceneController.loadingScenePreAnimationName = "";
     LoadingSceneController.LoadScene("HomeScene");
     //SDGameManager.Instance.ads
 }