Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     currentScene = SceneManager.GetActiveScene().name.ToString();
     Behaviour    = GameObject.FindGameObjectWithTag("Player").GetComponent <playerBehaviour>();
     inventory    = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>();
     PV           = Behaviour.getHP();
     TorchFuel    = Behaviour.getFuel();
     menuItems    = inventory.GetItems();
 }
Exemplo n.º 2
0
    // Update is called once per frame
    public void saveState()
    {
        PV        = Behaviour.getHP();
        TorchFuel = Behaviour.getFuel();
        menuItems = inventory.GetItems();

        currentScene = SceneManager.GetActiveScene().name.ToString();

        if (currentScene == "Level_2" || currentScene == "Level_3")
        {
            Behaviour = GameObject.FindGameObjectWithTag("Player").GetComponent <playerBehaviour>();
            inventory = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>();
        }
    }