void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(this);
         _swapTowerSystem = gameObject.AddComponent <SwapTowerSystem>();
         _swapTowerSystem.swapParticleSysPrefab = swapParticleSystem;
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#2
0
    void Awake()
    {
        Application.targetFrameRate         = 500;
        Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");

        _currentScene = GameScenes.MainMap;
        DontDestroyOnLoad(this);
        if (enableSwapSystem)
        {
            _swapTowerSystem = gameObject.AddComponent <SwapTowerSystem>();
            _swapTowerSystem.swapParticleSysPrefab = swapParticleSystem;
        }

        SaveSystem.canSave = enableSaveSystem;
    }