Advertisement
Guest User

Untitled

a guest
May 25th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEditor;
  3. using System;
  4.  
  5. public class MyAssetEditor {
  6.     [MenuItem("Assets/Create/MyAsset")]
  7.     public static void CreateMyAsset()
  8.     {
  9.         MyAsset asset = (MyAsset)ScriptableObject.CreateInstance("MyAsset");  //scriptable object
  10.         AssetUtility.CreateAsset(asset, "New MyAsset");
  11.         AssetUtility.SaveAsset(asset);
  12.         EditorUtility.FocusProjectWindow();
  13.         Selection.activeObject = asset;
  14.     }
  15. }
  16.  
  17. public class MyAsset : ScriptableObject {
  18.     public int i;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement