Singleton Script:
public static ShipSingleton Instance { get { return _instance; } }
private void Awake()
{
if (_instance != null && _instance != this)
{
Destroy(this.gameObject);
}
else
{
_instance = this;
DontDestroyOnLoad(this.gameObject);
}
}
public enum Ship
{
BasicShip
};
public Ship spawnShipID;
Spawner Object
public GameObject basicShip;
void Start()
{
if (ShipSingleton.Instance.spawnShipID == ShipSingleton.Ship.BasicShip)
{
Instantiate(basicShip, transform.position, Quaternion.identity);
}
}
Button Script
public Ship ShipID = ShipSingleton.Ship.BasicShip;
public void shipchoice()
{
SceneManager.LoadScene("watcherqueen");
ShipSingleton.Instance.spawnShipID = ShipID;
}
Keep getting this error:
Error CS0246 The type or namespace name 'Ship' could not be found (are you missing a using directive or assembly reference?
Is it possible I am missing a reference to the public enum in the button script?