read
For enum
defined in script, you can just declare it as public
.
public enum GameLevel { Intro, Level1, Level2, Level3, Inbetween };
public class GameManager : MonoBehaviour
{
public GameLevel gameLevel; // Editable in the editor
…
}
For class
, you should declare it as Serializable
like this.
public class LevelManager : MonoBehaviour
{
[SerializeField]
private List<Wave> _waves; // Editable in the editor
…
[System.Serializable] // let this class can be configuration in editor
public class Wave
{
[SerializeField]
private List<EnemyBehavior> _enemies; // all enemies in this wave
…
}
}