public static async UniTask <T> GetResourcesAsync <T> (ResourceRoleType roleType, ResourcesType type,
                                                        string resourceName)
     where T : UnityEngine.Object
 {
     return(await ResourcesLoadManager.Instance.GetResourcesAsync <T> (roleType.ToString(), type.ToString(),
                                                                       resourceName));
 }
Exemplo n.º 2
0
        public static T GetResources <T> (ResourceRoleType roleType, ResourcesType type, string resourceName,
                                          Transform parents)
            where T : PrefabComponent
        {
            T   obj;
            var poolingPath = $"{roleType}/{type}/{resourceName}";

            if (ObjectPoolingManager.Instance.IsExistPooledObject(poolingPath))
            {
                obj = ObjectPoolingManager.Instance.ReturnLoadResources <T> (poolingPath);
                obj.transform.SetParent(parents);
                obj.transform.SetInstantiateTransform();
                return(obj);
            }

            var res = ResourcesLoadManager.Instance.GetResources <T> (poolingPath);

            obj = res.InstantiateObject <T> (parents);
            obj.transform.SetInstantiateTransform();
            return(obj);
        }
 public static T GetResources <T> (ResourceRoleType roleType, string resourceName) where T : UnityEngine.Object
 {
     return(ResourcesLoadManager.Instance.GetResources <T> (roleType.ToString(), resourceName));
 }