private static Shader CreateShader(SWWindowMain edit,string txt)
		{
			string path = string.Format ("{0}{1}.shader", edit.folderPath, edit.data.title);
			string fullPath = SWCommon.Path2FullPath (path);
			string adbPath =  SWCommon.Path2AssetDBPath (path);
//			string guid = AssetDatabase.AssetPathToGUID (adbPath);
			File.WriteAllText(fullPath, txt );    
			AssetDatabase.ImportAsset(adbPath, ImportAssetOptions.ForceUpdate);
			Shader currentShader = AssetDatabase.LoadAssetAtPath<Shader> ( adbPath);
			return currentShader;
		}
Пример #2
0
        private static Shader CreateShaderFile(string path, string txt)
        {
            string fullPath = SWCommon.Path2FullPath(path);
            string adbPath  = SWCommon.Path2AssetDBPath(path);

            //			string guid = AssetDatabase.AssetPathToGUID (adbPath);
            File.WriteAllText(fullPath, txt);
            AssetDatabase.ImportAsset(adbPath, ImportAssetOptions.ForceUpdate);
            Shader currentShader = AssetDatabase.LoadAssetAtPath <Shader> (adbPath);

            return(currentShader);
        }