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