Пример #1
0
		//private 
		void Start ()
		{
				if (gamedata == null) {
						gamedata = this;
						//DontDestroyOnLoad (this);
				}
		}
Пример #2
0
 //private
 void Start()
 {
     if (gamedata == null)
     {
         gamedata = this;
         //DontDestroyOnLoad (this);
     }
 }
    // Use this for initialization
    void Awake()
    {
        if (Instance != null)
        {
            Destroy(gameObject);
            return;
        }

        Instance = this;
        DontDestroyOnLoad(this);
        GameDataSaveLoadManager.Instance.LoadGameData();
        //GameSettingsSaveLoadManager.Instance.LoadSettings();
        Debug.Log("[RPGAIO] Loaded game data and settings");
    }
Пример #4
0
    public void StartAfterCoordinator()
    {
        gameData    = GameObject.FindGameObjectWithTag("LoadGameData").GetComponent <LoadGameData>();
        mainLibrary = GameObject.FindGameObjectWithTag("MainLibrary").GetComponent <MainLibrary>();
        LoadBoardFromLibrary(gameData.boardID);
        GameObject.Destroy(gameData.gameObject);

        PlayerInfoCoordinator playerCoordinator = playerInterface.GetComponent <PlayerInfoCoordinator>();

        foreach (PlayerInfo player in playerList)
        {
            playerCoordinator.AddPlayer(player);
        }

        RenderBoard();
    }
    // Start is called before the first frame update
    void Start()
    {
        gridManager      = gameObject.GetComponent <GridManager>();
        allTilePositions = gridManager.allTilePositions;

        LoadGameData loadGameData = gameData.GetComponent <LoadGameData>();

        groundTileFromPosition = gridManager.GetComponent <GroundTileManager>().groundTiles;
        groundTileFromName     = loadGameData.groundTileFromName;
        plantTileFromName      = loadGameData.plantTileFromName;
        terrainFromName        = loadGameData.terrainFromName;
        plantFromName          = loadGameData.plantFromName;
        plantList = loadGameData.plants;
        GetPlantTiles();

        // To start spawning things, call the SpawnPlants method, which will start a coroutine.
        StartCoroutine(SpawnPeriodicPlants());
    }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        GetStores();
        GetStoreUpgrades();

        LoadGameData.LoadSaveGame();

        storePanelScrollbar.value = 1;

        //Set Current Balance Text
        currentBalance.text = "$" + balance.ToString();

        // Example of Observer pattern
        // Notify all observers that we have updated the game balance
        // This is how the interface knows to update without using updates
        if (OnUpdateBalance != null)
        {
            OnUpdateBalance();
        }
    }
Пример #7
0
    public void LoadGame()
    {
        List <string> names      = new List <string>();
        List <int>    times      = new List <int>();
        List <int>    increments = new List <int>();
        List <int>    delays     = new List <int>();

        foreach (GameConfigurationController playerInfo in playerInfoList)
        {
            names.Add(playerInfo.playerName);
            times.Add(playerInfo.initialTime * 1000);
            increments.Add(playerInfo.addedTime * 1000);
            delays.Add(playerInfo.delayTime * 1000);
        }

        LoadGameData gameData = GameObject.Instantiate(loadGameDataPrefab).GetComponent <LoadGameData>();

        gameData.Initialize(boardID, names, times, increments, delays);

        library.gameObject.GetComponent <SceneSwitcher>().LoadScene(boardType);
    }
Пример #8
0
 public AddGame()
 {
     gameData       = new LoadGameData();
     updateGameData = new UpdateGameData();
 }
Пример #9
0
 private void Start()
 {
     LoadGameData.LoadSaveGame(); // Loading game data
 }