Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        DOLDatabase DOLD = GameObject.FindGameObjectWithTag("LoadManager").GetComponent <DOLDatabase>();

        DontDestroyOnLoad(Player);
        DOLD.Add(Player);
        DontDestroyOnLoad(UICanvas);
        DOLD.Add(UICanvas.gameObject);
        DontDestroyOnLoad(Manager);
        DOLD.Add(Manager);
        DontDestroyOnLoad(TileMapManager);
        DOLD.Add(TileMapManager);
        DontDestroyOnLoad(LoadManager);
        DOLD.Add(LoadManager);
        DontDestroyOnLoad(ItemManager);
        DOLD.Add(ItemManager);
        DontDestroyOnLoad(XML);
        DOLD.Add(XML.gameObject);

        /*TEST REMOVE AFTER*/
        //Player.transform.position = new Vector3(9, 12, 0);

        Clock     cClock = GameObject.FindGameObjectWithTag("Canvas").GetComponent <Clock>();
        LoadLevel Load   = GameObject.FindGameObjectWithTag("LoadManager").GetComponent <LoadLevel>();

        if (SceneManager.GetActiveScene().name != "LoadSaveScene")
        {
            Load.TransferLevel("PlayerFarm", new Vector3(0, 0, 0));
        }
        else
        {
            Load.TransferLevel(cClock.SceneName, cClock.PlayerPos);
        }
    }
Пример #2
0
    void PlayerPassOut()
    {
        // Start the play transition
        Stam.SetStamina(75);
        NightUpdate();
        LoadLevel Load = GameObject.FindGameObjectWithTag("LoadManager").GetComponent <LoadLevel>();

        Load.TransferLevel("PlayerRoom", new Vector3(-1, 9, 0));
    }
Пример #3
0
 public void UseStamina(int Amount)
 {
     CurrentStam  -= Amount;
     StamBar.value = CurrentStam;
     if (CurrentStam <= 0)
     {
         // Start the play transition
         SetStamina(75);
         cClock.NightUpdate();
         LoadLevel Load = GameObject.FindGameObjectWithTag("LoadManager").GetComponent <LoadLevel>();
         Load.TransferLevel("PlayerRoom", new Vector3(-1, 9, 0));
     }
 }
Пример #4
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     Load = GameObject.FindGameObjectWithTag("LoadManager").GetComponent <LoadLevel>();
     Load.TransferLevel(LevelName, LoadPosition);
 }