public static PlayerPersistentStats GetPlayerPersistentStats() { if (playerPersistentStats == null) { playerPersistentStats = new PlayerPersistentStats(); } return(playerPersistentStats); }
// Use this for initialization void Start() { float pX = PlayerPersistentStats.GetPlayerPersistentStats().GetPX(); float pY = PlayerPersistentStats.GetPlayerPersistentStats().GetPY(); Vector2 loadPos = new Vector2(pX, pY); transform.position = loadPos; }
// Update is called once per frame void Update() { if (Input.GetButtonDown("Fire1")) { PlayerPersistentStats.GetPlayerPersistentStats().SetPX(0.0f); PlayerPersistentStats.GetPlayerPersistentStats().SetPY(0.0f); SceneManager.LoadScene(1); } }