Пример #1
0
    public void OnEnable()
    {
        if (UpdateRequired())
        {
            if (EditorUtility.DisplayDialog("Update Required",
                                            "The latest verison of Tiler requires saved data to be updated before proceeding.\n" +
                                            "It is advised you backup before hitting update.\n", "Update", "Cancel"))
            {
                EditorPrefs.SetInt("TilerVersion", TilerVersion);

                UnityUpdate.PerformCheck();
            }
            else
            {
                _isClosing = true;
            }
        }

        wantsMouseMove = true;

        if (_section == null)
        {
            return;
        }

        _section.OnEnable();
    }
Пример #2
0
 public Timer(float startTime, Action timeoutCallback)
 {
     time       = startTime;
     maxTime    = startTime;
     onTimeout += timeoutCallback;
     UnityUpdate.Add(this);
 }
Пример #3
0
        private IEnumerator Start()
        {
            AsyncOperationHandle <TextAsset> configHandle = Addressables.LoadAssetAsync <TextAsset>("config.txt");

            yield return(configHandle);

            Config config = JsonConvert.DeserializeObject <Config>(configHandle.Result.text,
                                                                   new JsonSerializerSettings {
                TypeNameHandling = TypeNameHandling.Objects
            });

            if (config == null)
            {
                Debug.LogError($"Could not deserialize Config with contents: {configHandle.Result.text}");
                yield break;
            }

            config.Init();

            Assets assets = new Assets();

            yield return(assets.LoadSprites("items", "entities", "common"));

            yield return(assets.LoadPrefabs("system"));

            yield return(assets.LoadTilemaps(config.Get <MapSystemConfig>().tilemaps));

            ctx  = new Context(config, assets, new EventPump());
            Game = new Game(ctx);

            UnityUpdate.Add(this);
        }
Пример #4
0
    private void Setup()
    {
        //position = new Rect(50,50,1003,720);

        UnityUpdate.PerformCheck();

        if (_section != null)
        {
            _section.Destroy();
        }

        SetSection(new DrawWindow(this));

        title = "Tiler";
    }
Пример #5
0
 public void Stop()
 {
     UnityUpdate.Remove(this);
 }