Beispiel #1
0
    /// <summary>
    /// It sets Program.MyScreen1.TerraRoot so it loads the terrain saved
    /// </summary>
    /// <param name="p"></param>
    static void SetLoadedTerrainInTerraRoot()
    {
        PersonData pData = XMLSerie.ReadXMLPerson();

        //so it loads the saved terrain into the new game
        Program.MyScreen1.TerraRoot = MyScreen.AddPrefabTerrainRoot(pData.PersonControllerSaveLoad.TerrainName);
    }
Beispiel #2
0
    void Start()
    {
        _body  = GetChildCalled("Body_Lbl").GetComponent <Text>();
        iniPos = transform.position;

        Hide();

        _workers    = new SubBulletinGeneral(this);
        _production = new SubBulletinProduction(this);
        _finance    = new SubBulletinFinance(this);

        //
        _scroll  = GetChildCalled("Scroll_View");
        _content = GetGrandChildCalledFromThis("Content", _scroll);
        _contentRectTransform = _content.GetComponent <RectTransform>();
        _scroll_Ini_PosGO     = GetChildCalledOnThis("Scroll_Ini_Pos", _content);

        var h = GetChildCalled("Help");

        _help      = h.GetComponent <Text>();
        _help.text = "";


        //bz GUI Loades like 4 times
        PersonData pData = XMLSerie.ReadXMLPerson();

        var tempData = Program.gameScene.ProvideMeWithTempData();

        //means is reloading from a change in GUI a
        if (tempData != null)
        {
            pData = tempData;
        }

        //loading
        if (pData != null)
        {
            SubBulletinProduction1 = pData.PersonControllerSaveLoad.SubBulletinProduction;
            SubBulletinProduction1.BulletinWindow1 = this;

            if (pData.PersonControllerSaveLoad.SubBulletinFinance != null)
            {
                SubBulletinFinance1 = pData.PersonControllerSaveLoad.SubBulletinFinance;
                SubBulletinFinance1.BulletinWindow1 = this;
            }
        }



        //means is brand new game
        if (_finance.FinanceLogger.Budgets.Count == 0)
        {
            _finance.FinanceLogger.AddYearBudget();
        }
    }
Beispiel #3
0
    private void LoadUnlockRegions()
    {
        PersonData pData = XMLSerie.ReadXMLPerson();

        //if new game
        if (pData == null)
        {
            return;
        }

        //it saves at PersonSaveLoad
        _unlockRegions = pData.PersonControllerSaveLoad.UnlockRegions;
    }
Beispiel #4
0
    /// <summary>
    /// Once data is loaded the Book has to be redo
    /// </summary>
    void RedoStuffWithLoadedData()
    {
        //means is a new game and this below is not needed
        if (Program.MyScreen1.HoldDifficulty != -1)
        {
            return;
        }

        Program.MyScreen1.HoldDifficulty = PersonPot.Control.Difficulty;

        _book = new Book();
        _book.Start();

        PersonData pData = XMLSerie.ReadXMLPerson();

        Program.IsPirate      = pData.PersonControllerSaveLoad.IsPirate;
        Program.IsFood        = pData.PersonControllerSaveLoad.IsFood;
        Program.WasTutoPassed = pData.PersonControllerSaveLoad.WasTutoPassed;
    }
Beispiel #5
0
    public void Initialize()
    {
        if (!MeshController.CrystalManager1.IsFullyLoaded() || !Program.GameFullyLoaded())//making sure all build are fullt loaded
        {
            return;
        }
        init = false;

        PersonData pData = XMLSerie.ReadXMLPerson();

        CamControl.CAMRTS.InputRts.SaveFirstCamPos();

        //brand new game
        if (pData == null)
        {
            SpawnIniPersonas();
            GameController.LoadStartingConditions(conditions[Difficulty]);
            RestartController();

            //here bz trees all spawneed after buildings.
            //so if tree is inside a building wont be deleted. bz the building
            //might be to big and wont collide with the building
            BuildingPot.Control.Registro.DoLastStepOfTownLoaded();
        }
        //loading from file game
        else
        {
            LoadFromFile(pData);
            //game controller is loaded and Saved on BuildingSaveLoad.cs

            //called here for the first time after a Storage was build.
            //This is DEBUG
            GameController.LoadStartingConditions(conditions[Difficulty]);
            CamControl.CAMRTS.InputRts.LoadLastCamPos();
        }
        BuildingPot.CreateUnlockBuilds();
        MeshController.InitBuyRegions();

        Program.gameScene.GameController1.ReCheckWhatsOnStorage();
        Program.gameScene.ReleaseLoadingScreen();
    }