Im trying to pass a static class that holds a double type number, wich is the game currency, and since it has to be available in all scenes (coding in unity) that's the way I saw to access it easily. What I am trying to do here is set the static value in the playerdata script wich is part of my savesystem, so the static value once changed, can be saved between scenes.
this is in the playerdata script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
[System.Serializable]
public class PlayerData
{
public double money;
public PlayerData (GameController player)
{
//This is where I get the error Member 'GameController.money' cannot be accessed with an instance
//reference; qualify it with a type name instead
GameController.money = player.money;
}
}
this is in the GameController script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System;
public class GameController : MonoBehaviour
{
static public double money = 1;
}