public ResourceRequest Loader(string Path) { // Callback action System.Action <UnityEngine.Object, System.Action <UnityEngine.Object> > DoJob = (asset, callback) => { Object obj = null; this.Cache.TryGetValue(Path, out obj); if (obj == null) { this.Cache.Add(Path, obj); obj = Modeling.LoadPrefab(asset); } callback?.Invoke(obj); }; var AsysnJob = AsyncLoader.LoadAsyncObject <GameObject>(Path, DoJob, callback: beLoaded => { //var AI = (beLoaded as GameObject).GetComponent<ClassA>(); //Debug.LogError(AI.name); //Nothi } ); return(AsysnJob); }
public static void LoadAsyncObject(string path, System.Action callback = null, string tag = "Default", Transform parent = null) { LoadModel.LoadAsyncObject <GameObject>(path, () => { Modeling.LoadPrefab(path, tag, parent); callback?.Invoke(); }); }
public static void LoadAsyncObject(string path, Quaternion localRotation, string tag = GameTag.Player, Transform parent = null) { AsyncModeling.AsyncLoader.LoadAsyncObject <GameObject>(path, () => Modeling.LoadPrefab(path, tag, parent)); }
public static void LoadAsyncObject(string path, Quaternion localRotation, string tag = "Player", Transform parent = null) { LoadModel.LoadAsyncObject <GameObject>(path, () => Modeling.LoadPrefab(path, tag, parent)); }