示例#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");
    }
    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
 }