Ejemplo n.º 1
0
 public static Texture2D Texture(SWUITex e)
 {
     if (!texDic.ContainsKey(e))
     {
         string path = SWCommon.ProductFolder() + "/UI/";
         var    item = AssetDatabase.LoadAssetAtPath <Texture2D> (path + texPathDic[e]);
         if (item != null)
         {
             texDic.Add(e, item);
         }
     }
     return(texDic[e]);
 }
Ejemplo n.º 2
0
 public static Material GetMaterial(string name)
 {
     if (!matDic.ContainsKey(name))
     {
         string path = SWCommon.ProductFolder() + "/Materials/";
         var    item = AssetDatabase.LoadAssetAtPath <Material> (path + name + ".mat");
         if (item != null)
         {
             matDic.Add(name, item);
         }
     }
     return(matDic[name]);
 }
Ejemplo n.º 3
0
 public static Shader GetShader(string name)
 {
     if (!shaderDic.ContainsKey(name))
     {
         string path = SWCommon.ProductFolder() + "/Shaders/";
         var    item = AssetDatabase.LoadAssetAtPath <Shader> (path + name + ".shader");
         if (item != null)
         {
             shaderDic.Add(name, item);
         }
     }
     return(shaderDic[name]);
 }
 void Init()
 {
     if (preview == null)
     {
         GameObject obj = GameObject.Find(name);
         if (obj == null)
         {
             GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject> (
                 SWCommon.ProductFolder() + "/Prefabs/Preview.prefab");
             obj           = GameObject.Instantiate(prefab);
             obj.name      = name;
             obj.hideFlags = HideFlags.HideInHierarchy;
         }
         preview = obj.GetComponent <SWPreview> ();
         preview.Init(startPos);
     }
 }