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);
        }
 public void Play(string clipPath)
 {
     Play(UResources.Load <AudioClip>(clipPath));
 }