Jump to content
Unity Insider Forum

Wizard wird nicht geöffnet


Recommended Posts

Hallo Leute ich habe folgendes Script geschrieben:

Es soll ein Wizard erstellt werden in dem ich dann Items erstellen kann. Der Pfad Assets Items Item ist auch in Unity zu finden nur wenn ich drauf drücke passiert nichts. Stimmt da was mit dem Script nicht oder muss ich da in Unity noch was ändern ? Danke im voraus :D

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class ItemWizzard : ScriptableWizard
{
    public string ItemName;
    public Sprite Icon;
    public int StackSize;
    public int ID;

    [MenuItem("Assets/Items/Item")]
    public static void creat()
    {
        ScriptableWizard.CreateInstance<ItemWizzard>();
    }

    private void OnWizardCreate()
    {
        ItemCreate i = ScriptableObject.CreateInstance<ItemCreate>();
        i.ItemName = ItemName;
        i.Icon = Icon;
        i.StackSize = StackSize;
        i.ID = ID;

        AssetDatabase.CreateAsset(i, "Assets/Prefabs/" + ItemName + "_item" + ".asset");
        AssetDatabase.Refresh();
    }
}

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...