Last active
August 29, 2015 14:05
-
-
Save eral/0929e8f14d1dfc763798 to your computer and use it in GitHub Desktop.
Original Material
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by ERAL | |
// This is free and unencumbered software released into the public domain. | |
using UnityEngine; | |
public class OriginalMaterial : ScriptableObject { | |
public string m_data; | |
#if UNITY_EDITOR | |
private const string menuName = "Original Material"; | |
private const string fileName = "New Original Material.asset"; | |
[UnityEditor.MenuItem("Assets/Create/" + menuName)] | |
public static void Create() { | |
var asset = ScriptableObject.CreateInstance<OriginalMaterial>(); | |
UnityEditor.ProjectWindowUtil.CreateAsset(asset, fileName); | |
} | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unity5.1以降は組み込み関数で出来る様に為りました。
UnityEngine.CreateAssetMenuAttribute