void Awake()
 {
     if (Prefabs != null)
     {
         foreach (var prefab in Prefabs)
         {
             GameObject g = Instantiate <GameObject>(prefab);
             if (_asParent)
             {
                 g.transform.SetParent(transform, false);
             }
         }
     }
     if (PrefabsInRes != null)
     {
         foreach (var s in PrefabsInRes)
         {
             GameObject g = Instantiate <GameObject>(UResources.Load <GameObject>(s));
             if (_asParent)
             {
                 g.transform.SetParent(transform, false);
             }
         }
     }
 }
Пример #2
0
        public static Object Load(string path, Type type)
        {
            var    localizationPath = Localization.ConvertAssetPath(path);
            Object result           = UResources.Load(localizationPath, type);

            if (result == null)
            {
                result = UResources.Load(path, type);
            }
            return(result);
        }
Пример #3
0
 public void Play(string clipPath)
 {
     Play(UResources.Load <AudioClip>(clipPath));
 }