Last active
August 29, 2015 14:07
-
-
Save TakaakiIchijo/082f19cf739f8de664b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void CreateScriptableObjectAndSave(string assetPath) | |
{ | |
//アセットの生成// | |
AssetDatabase.CreateAsset ((ScriptableObject)someScriptableObject, assetPath); | |
//変更ここから// | |
AssetDatabase.StartAssetEditing(); | |
//ここで生成したScriptableObjectにデータを入れる処理// | |
//変更ここまで// | |
AssetDatabase.StopAssetEditing(); | |
//変更をUnityEditorに伝える// | |
EditorUtility.SetDirty(someScriptableObject); | |
//すべてのアセットを保存// | |
AssetDatabase.SaveAssets(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment