Exemplo n.º 1
0
        public UnityEngine.Object  LoadTmpl(string name)
        {
            string[] strList = name.Split(new Char[] { '/', }, StringSplitOptions.RemoveEmptyEntries);
            string   index   = strList[strList.Length - 1];

            UnityEngine.Object obj = LoadResource.Load(name);
            _dictTmpl[index] = obj;
            return(obj);
        }
Exemplo n.º 2
0
        static public UnityEngine.GameObject LoadAsGameObj(string path)
        {
            GameObject ins = null;
            var        obj = LoadResource.Load(path);

            if (obj != null)
            {
                ins = UnityEngine.Object.Instantiate(obj) as GameObject;
                if (null != ins)
                {
                    ins.name = obj.name;
                }
                else
                {
                    ZLog.E(null, "{0} Instantiate fail", path);
                }
            }

            return(ins);
        }