CreateAssetMenu doesn't show up

Hey folks,

I have a problem with my code and I don’t know what’s wrong. I want to create an AssetMenu but it doesn’t show up in unity. The two scripts I’m using are:

ChooseScene.cs:

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

[CreateAssetMenu(fileName = "NewChooseScene", menuName = "Data/New Choose Scene")]
[System.Serializable]
public class ChooseScene : GameScene
{
    public List<ChooseLabel> labels;

    [System.Serializable]
    public struct ChooseLabel
    {
        public string text;
        public StoryScene nextScene;
    }
}

and StoryScene.cs:

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

[CreateAssetMenu(fileName = "NewStoryScene", menuName = "Data/New Story Scene")]
[System.Serializable]
public class StoryScene : GameScene
{
    public List<Sentence> sentences;
    public Sprite background;
    public GameScene nextScene;

    [System.Serializable]
    public struct Sentence
    {
        public string text;
        public Speaker speaker;
    }
}

public class GameScene : ScriptableObject { }

In my StoryScene.cs I create the GameScene as ScriptableObject, but in ChooseScene I declare ChooseScene as GameScene and in my opinion it should work, but it doesn’t…

Greets,
One

Worked for me. You save your code?

1 Like

And on top of this, make sure there’s no compiler errors elsewhere in your project.

2 Likes

Check Speaker type script

public Speaker speaker;

i have tried the script by removing this line and it works great for me.
best of luck

You were right, I got a compiler error and I thought I fix it later but this was the issue.

Thanks

-closed