Esempio n. 1
0
    private void PickMonth()
    {
        int monthMaxIndex = System.Enum.GetNames(typeof(MonthInfo.Months)).Length - 1;
        int index         = Random.Range(1, monthMaxIndex);

        this.month = (MonthInfo.Months)System.Enum.GetValues(typeof(MonthInfo.Months)).GetValue(index);
    }
Esempio n. 2
0
 public GameData(RestaurantInfo.Types restaurantType, MonthInfo.Months month,
                 int totalScore, int daysPassed)
 {
     this.restaurantType = (int)restaurantType;
     this.month          = (int)month;
     this.totalScore     = totalScore;
     this.daysPassed     = daysPassed;
 }
Esempio n. 3
0
    private void LoadGame()
    {
        if (SaveFileExists())
        {
            BinaryFormatter binaryFormatter = new BinaryFormatter();
            FileStream      stream          = new FileStream(SAVE_PATH, FileMode.Open);
            GameData        gameData        = (GameData)binaryFormatter.Deserialize(stream);

            this.currentRestType = (RestaurantInfo.Types)gameData.restaurantType;
            this.month           = (MonthInfo.Months)gameData.month;
            this.totalScore      = gameData.totalScore;
            this.daysPassed      = gameData.daysPassed;
        }
        else
        {
            throw new System.Exception("Save file not found at " + SAVE_PATH);
        }
    }
Esempio n. 4
0
 public Month(MonthInfo.Months name, MonthInfo.Seasons season, GameObject calendarPrefab)
 {
     this.name           = name;
     this.season         = season;
     this.calendarPrefab = calendarPrefab;
 }
Esempio n. 5
0
 public void SetMonth(MonthInfo.Months month)
 {
     this.month = month;
 }
Esempio n. 6
0
 public MonthInfo.Seasons GetMonthSeason(MonthInfo.Months month)
 {
     return(monthPrefabs[month].GetSeason());
 }
Esempio n. 7
0
 public GameObject GetMonthPrefab(MonthInfo.Months month)
 {
     return(monthPrefabs[month].GetPrefab());
 }
Esempio n. 8
0
 private void SetSprites()
 {
     MonthInfo.Months  month  = this.gameManager.GetMonth();
     MonthInfo.Seasons season = this.monthBuilder.GetMonthSeason(month);
     backgroundWindow.sprite = Resources.Load <Sprite>(seasonalBackgroundSpritePaths[season]);
 }