protected override void Awake() { base.Awake(); if (Cache == null) { Cache = new MemoryCache(); } Cache.Handler = new SimpleDownloadHandler(); Cache.UrlLocator = new SimpleUrlLocator(); Cache.CacheLocator = new SimpleCacheLocator(); if (GameObject.FindGameObjectsWithTag("ApplicationObject").Length > 1) { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); Screen.sleepTimeout = SleepTimeout.NeverSleep; Application.targetFrameRate = 120; ZPlayerPrefs.Initialize(SecuredConstants.password, SecuredConstants.salt); UseDoozyUi = Type.GetType("DoozyUI.UIElement") != null; OriginalWidth = Screen.width; OriginalHeight = Screen.height; }
void OnGUI() { GUILayout.Label("Setting", EditorStyles.boldLabel); this.Cache = this.RenderSettingSection(); GUILayout.Label("Cache", EditorStyles.boldLabel); this.RenderCacheSection(this.Cache); }
public void SetUp() { this.cache = new MemoryCacheForTest(); this.cache.UrlLocator = new SimpleUrlLocator(); this.cache.Handler = new TestCacheHandler(); this.cache.CacheLocator = new SimpleCacheLocator(); this.cache.Clear(); }
/// <summary> /// Initialize instance /// </summary> public override void Initialize() { base.Initialize(); _cache = new FileCache(gameObject); _cache.Handler = new SimpleDownloadHandler(); _cache.UrlLocator = new SimpleUrlLocator(); _cache.CacheLocator = new SimpleCacheLocator(); }
public void SetUp() { var go = new GameObject(); this.cache = new FileCacheForTest(go); this.CacheLocator = new SimpleCacheLocator(); this.cache.UrlLocator = new SimpleUrlLocator(); this.cache.Handler = new TestCacheHandler(); this.cache.CacheLocator = new SimpleCacheLocator(); this.cache.Clear(); }
void Start() { this.cache = new FileCache(this.gameObject); this.cache.Handler = new SimpleDownloadHandler(); this.cache.UrlLocator = new SimpleUrlLocator(); this.cache.CacheLocator = new SimpleCacheLocator(); this.LoadButton.onClick.AddListener(Fetch); this.ClearImageButton.onClick.AddListener(ClearImage); this.ClearCacheButton.onClick.AddListener(ClearCache); this.LoadingText.enabled = false; this.Image.enabled = false; }
void RenderCacheSection(IUnicache cache) { if (cache == null) { return; } { this._scrollPosition = EditorGUILayout.BeginScrollView(this._scrollPosition, GUI.skin.box); this.RenderCachePathHeader(); foreach (var path in cache.ListPathes()) { this.RenderCachePath(path); } EditorGUILayout.EndScrollView(); } }
IUnicache RenderSettingSection() { this.Selected = this.LoadObject(); this.Selected = EditorGUILayout.ObjectField( "IUnicacheGetter", this.Selected, typeof(GameObject), true ) as GameObject; IUnicache cache = null; var getter = (this.Selected != null) ? this.Selected.GetComponent <IUnicacheGetter>() : null; if (getter != null) { this.SaveObject(this.Selected); cache = getter.Cache; } else { this.Selected = null; cache = null; } if (this.Selected == null) { EditorGUILayout.HelpBox( "Please Set GameObject which component implement IUnicacheGetter", MessageType.None); } return(cache); }
public void Setup() { this.cache = new MemoryCache(); this.cache.CacheLocator = new SimpleCacheLocator(); this.cache.Clear(); }