Exemplo n.º 1
0
    void Awake()
    {
        _editor       = GlobalOptions.GetEditorComponent();
        _library      = _editor.Library;
        _cubeList     = _library.GetList();
        _previewArray = _library.GetImageList();

        RebuildMenu();
    }
Exemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        CubeLibrary TargetLibrary = (CubeLibrary)target;
        List <Cube> CubeList      = TargetLibrary.GetList();

        DrawDefaultInspector();

        if (GUILayout.Button("Add"))
        {
            //Cube obj = ScriptableObject.CreateInstance<Cube>();
            Cube obj = new Cube();
            CubeList.Add(obj);
        }

        if (GUILayout.Button("Clear"))
        {
            CubeList.Clear();
        }
    }