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); }
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; }
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); } }
public Month(MonthInfo.Months name, MonthInfo.Seasons season, GameObject calendarPrefab) { this.name = name; this.season = season; this.calendarPrefab = calendarPrefab; }
public void SetMonth(MonthInfo.Months month) { this.month = month; }
public MonthInfo.Seasons GetMonthSeason(MonthInfo.Months month) { return(monthPrefabs[month].GetSeason()); }
public GameObject GetMonthPrefab(MonthInfo.Months month) { return(monthPrefabs[month].GetPrefab()); }
private void SetSprites() { MonthInfo.Months month = this.gameManager.GetMonth(); MonthInfo.Seasons season = this.monthBuilder.GetMonthSeason(month); backgroundWindow.sprite = Resources.Load <Sprite>(seasonalBackgroundSpritePaths[season]); }