I’m having an issue with variables showing up in the Inspector with my files. One of my older files seems to be showing the variables, but it was made awhile ago. All the new files I create seem to not show up in the Inspector, like the script file below. I tried doing a public variable and private variable with the SerializeField above it, but neither show up in the inspector. Could anyone give me advice or help? We’re doing dev on the iOS, not sure if that affects anything. Thank you.
using UnityEngine;
using System.Collections;
//Use this class to store data you will need at runtime for each level. I have attached it to an empty game object in the prototype level
//This class is not meant to persist between scenes
public class PrototypeLevelData : MonoBehaviour
{
private static PrototypeLevelData instance = null;
public static PrototypeLevelData Instance
{
get
{
if( instance == null )
{
Debug.Log( "instantiate PrototypeLevelData" );
GameObject go = new GameObject( );
instance = go.AddComponent<PrototypeLevelData>( );
go.name = "PrototypeLevelDatasingleton";
}
return instance;
}
}
public static uint initialBallCount;// = 0;
// public uint InitialBallCount
// {
// get { return initialBallCount; }
// private set { initialBallCount = value; }
// }
[SerializeField]
private uint ballsRemaining = 0;
public uint BallsRemaining
{
get { return ballsRemaining; }
set { ballsRemaining = value; }
}
private uint currentScore = 0;
public uint CurrentScore
{
get { return currentScore; }
set
{
currentScore = value;
if( HighScore < currentScore )
{
HighScore = currentScore;
}
}
}
public uint HighScore = 0;
void Awake()
{
Debug.Log( "PrototypeLevelData Awake" );
DontDestroyOnLoad( this );
}
// Use this for initialization
void Start()
{
Debug.Log( "PrototypeLevelData Start" );
initialBallCount = 5;
ballsRemaining = initialBallCount;
}
// Update is called once per frame
void Update()
{
Debug.Log( "PrototypeLevelData Update" );
}
}
