コード例 #1
0
        public void Import(string fullname)
        {
            string metaPath = string.Format("{0}.meta", fullname);

            if (!System.IO.File.Exists(metaPath))
            {
                using (var fs = System.IO.File.OpenWrite(metaPath))
                {
                    fs.Close();
                }
            }

            //var content = System.IO.File.ReadAllBytes(fullname);
            //// 这里临时存的是string
            //string txt = Encoding.UTF8.GetString(content, 0, content.Length);
            //int idx = txt.IndexOf('\r');
            //if (idx >= 0)
            //    txt = txt.Substring(0, idx);
            //Shader shader = Shader.Find(txt);
            curMat = new Material(fullname);

            AssetManager.AddOrUpAsset(fullname, curMat);
        }