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(); }
public Timer(float startTime, Action timeoutCallback) { time = startTime; maxTime = startTime; onTimeout += timeoutCallback; UnityUpdate.Add(this); }
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); }
private void Setup() { //position = new Rect(50,50,1003,720); UnityUpdate.PerformCheck(); if (_section != null) { _section.Destroy(); } SetSection(new DrawWindow(this)); title = "Tiler"; }
public void Stop() { UnityUpdate.Remove(this); }