1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| public static class AssetsMenu { [MenuItem("Assets/Create HLSL")] public static void CreateHLSL() { string assetPath = Path.Combine(GetCurrentAssetDirectory(), "temp.hlsl"); assetPath = AssetDataBase.generateuniqueAssetPath(assetPath); AssetDataBase.CreateAsset(new TextAsset("--", assetPath); File.WriteAllText(assetPath, ""); AssetDataBase.SaveAssets(); AssetDataBase.Refresh(); } }
|