public static void CreatePrefabAsync(AssetUri Uri, LiteAction <GameObject> Callback = null) { Loader_.CreatePrefabAsync(Uri, Callback); }
public static void CreateDataAsync(AssetUri Uri, LiteAction <byte[]> Callback = null) { Loader_.CreateDataAsync(Uri, Callback); }
public static void PreloadedAsset <T>(string AssetPath, LiteAction <bool> Callback) where T : UnityEngine.Object { Loader_.PreloadedAsset <T>(AssetPath, Callback); }
public static void CreateAssetAsync <T>(AssetUri Uri, LiteAction <T> Callback = null) where T : UnityEngine.Object { Loader_.CreateAssetAsync <T>(Uri, Callback); }
public void PreloadedAsset <T>(string AssetPath, LiteAction <bool> Callback) where T : UnityEngine.Object { var AssetType = GetAssetTypeWithName <T>(AssetPath); LoadAssetAsync <T>(AssetType, AssetPath, Callback); }
public void Initialize(int TotalCount, int Index, LiteFunc <int, LiteLoopViewItem> CreateItem, LiteAction <LiteLoopViewItem> DeleteItem, LiteAction <int, LiteLoopViewItem> UpdateItem) { LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent <RectTransform>()); ViewBounds_ = new Bounds(Viewport.rect.center, Viewport.rect.size); ViewItemCount_ = InternalCalculateViewItemCount(); Content.sizeDelta = InternalCalculateContentSize(); ContentBounds_ = GetBounds(); if (ViewItemCount_ > TotalCount) { ViewItemCount_ = TotalCount; } this.TotalCount = TotalCount; this.Content.sizeDelta = InternalCalculateContentSize(); this.CurrentIndex_ = Mathf.Clamp(Index, 0, TotalCount - ViewItemCount_); this.PreviousIndex_ = this.CurrentIndex_; this.OnCreateItem_ = CreateItem; this.OnDeleteItem_ = DeleteItem; this.OnUpdateItem_ = UpdateItem; this.Dragging_ = false; this.PrevPosition_ = Vector2.zero; this.Velocity_ = Vector2.zero; this.IsInit_ = true; FillItemList(); }
protected virtual void LoadAssetAsync <T>(AssetCacheType AssetType, string AssetPath, LiteAction <bool> Callback = null) where T : UnityEngine.Object { AssetPath = AssetPath.ToLower(); if (AssetCacheExisted(AssetPath)) { Callback?.Invoke(true); return; } if (!AssetLoadCallbackList_.ContainsKey(AssetPath)) { AssetLoadCallbackList_.Add(AssetPath, new List <LiteAction <bool> > { Callback }); LoadAssetCacheCompletedAsync <T>(AssetType, AssetPath, (IsLoaded) => { foreach (var LoadCallback in AssetLoadCallbackList_[AssetPath]) { LoadCallback?.Invoke(IsLoaded); } AssetLoadCallbackList_.Remove(AssetPath); }); } else { AssetLoadCallbackList_[AssetPath].Add(Callback); } }
public static void RemoveEvent(GameEntity Entity, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { EventHelper.RemoveEvent(Entity, Callback, Type); }
public void AddCallback(LiteAction <EventSystemData> Callback) { EventCallback_ += Callback; }
public static void RemoveCallback(Transform Master, EventSystemType Type, LiteAction <EventSystemData> Callback) { GetOrCreateHandler(Master.gameObject, Type).RemoveCallback(Callback); }
public void Dispose() { EventCallback_ = null; EventCallbackEx_ = null; }
public static void RemoveEventFromChild(GameEntity Entity, string ChildPath, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { EventHelper.RemoveEventFromChild(Entity, ChildPath, Callback, Type); }
public static void RemoveEventFromChild(Transform Parent, string ChildPath, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { EventHelper.RemoveEventFromChild(Parent, ChildPath, Callback, Type); }
public abstract void Play(string AnimationName, bool IsLoop = false, LiteAction Callback = null);
private void LoadAssetCacheCompletedAsync <T>(AssetCacheType AssetType, string AssetPath, LiteAction <bool> Callback = null) where T : UnityEngine.Object { var Cache = CreateAssetCache <T>(AssetType, AssetPath); if (Cache == null) { Callback?.Invoke(false); return; } AssetCacheList_.Add(AssetPath, Cache); LoadAssetCacheDependenciesAsync <UnityEngine.Object>(Cache, (IsLoaded) => { if (!IsLoaded) { Callback?.Invoke(false); return; } TaskManager.AddTask(LoadAssetCacheAsync <T>(Cache), () => { Callback?.Invoke(true); }); }); }
protected override void LoadAssetAsync <T>(AssetCacheType AssetType, string AssetPath, LiteAction <bool> Callback = null) { AssetPath = AssetPath.ToLower(); if (!AssetBundlePathList_.Contains(AssetPath)) { Callback?.Invoke(false); return; } base.LoadAssetAsync <T>(AssetType, AssetPath, Callback); }
public static void RemoveEvent(Transform Obj, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { EventHelper.RemoveEvent(Obj, Callback, Type); }