/// <summary> /// Sets the current time slot to the next time slot. /// Returns whether next time slot is in a new day. /// </summary> public bool GoToNextTimeSlot() { switch (currentTimeSlot) { case TimeSlotType.Morning: currentTimeSlot = TimeSlotType.Afternoon; break; case TimeSlotType.Afternoon: currentTimeSlot = TimeSlotType.Evening; break; case TimeSlotType.Evening: currentTimeSlot = TimeSlotType.Morning; // return fact that next time slot is in a new day return(true); default: // print warning to console Debug.LogWarning($"Invalid currentTimeSlot: {currentTimeSlot.ToString()}"); break; } // getting here means that next time slot is in the same day return(false); }
private void Setup(TimeCalendarSystem templateArg) { currentDateTime = new DateTime(templateArg.currentDateTime.Year, templateArg.currentDateTime.Month, templateArg.currentDateTime.Day); currentTimeSlot = templateArg.currentTimeSlot; }
private void Setup() { // start some ways into year on a monday currentDateTime = new DateTime(2020, 3, 2); currentTimeSlot = TimeSlotType.Morning; }
public static Sprite LoadBundleAssetHavenLocationEventDialogueBackground( string eventIdArg, TimeSlotType timeSlotArg) { // initialize bundle properties string BUNDLE_NAME = "HavenLocationEventDialogueBackground"; string ASSET_NAME_PREFIX = $"eve-{eventIdArg}/bg-"; // get start of name of asset to load string loadAssetName = ASSET_NAME_PREFIX + GetTimeDayIdAppend(timeSlotArg); // load and return asset return(LoadBundleAsset <Sprite>(BUNDLE_NAME, loadAssetName)); }
private void Setup() { dialogueName = string.Empty; requiredAdditionalGroupTraitProgression = 0; requiredFlag = string.Empty; associatedCharId = string.Empty; waifuChar = WaifuCharacterType.None; // sets the character ID based on the set waifu char type, if appropriate SetupCharIdFromWaifuChar(); associatedTimeSlot = TimeSlotType.None; focusesOnHcontent = false; }
private void Setup(DialogueEventData templateArg) { dialogueName = templateArg.dialogueName; requiredAdditionalGroupTraitProgression = templateArg. requiredAdditionalGroupTraitProgression; requiredFlag = templateArg.requiredFlag; associatedCharId = templateArg.associatedCharId; waifuChar = templateArg.waifuChar; // sets the character ID based on the set waifu char type, if appropriate SetupCharIdFromWaifuChar(); associatedTimeSlot = templateArg.associatedTimeSlot; focusesOnHcontent = templateArg.focusesOnHcontent; }
public static TimeSlot CreateTimeSlot(TimeSlotType timeSlotType) { switch (timeSlotType) { case TimeSlotType.Control: return(new ControlTimeSlot()); case TimeSlotType.Examination: return(new ExaminationTimeSlot()); case TimeSlotType.Intervention: return(new InterventionTimeSlot()); } throw new ArgumentException( "Unrecognized type of time slot", nameof(timeSlotType)); }
/// <summary> /// Returns the icon associated with the given time slot. /// </summary> /// <param name="timeSlotArg"></param> /// <returns></returns> private Sprite GetTimeOfDayIcon(TimeSlotType timeSlotArg) { switch (timeSlotArg) { case TimeSlotType.Morning: return(timeOfDayIconMorning); case TimeSlotType.Afternoon: return(timeOfDayIconAfternoon); case TimeSlotType.Evening: return(timeOfDayIconEvening); default: return(null); } }
void SetTimeSlotType(int hour) { if (hour >= 5 && hour < 11)//早上 { curTimeSlotType = TimeSlotType.Morning; } else if (hour >= 11 && hour <= 13)//中午 { curTimeSlotType = TimeSlotType.Noon; } else if (hour > 13 && hour <= 17)//下午 { curTimeSlotType = TimeSlotType.Afternoon; } else if (hour > 17 && hour <= 21)//晚上 { curTimeSlotType = TimeSlotType.Night; } }
/// <summary> /// Returns the string ID that should be appeneded onto a load file asscoiated /// with the given time slot. /// </summary> /// <param name="timeSlotArg"></param> /// <returns></returns> private static string GetTimeDayIdAppend(TimeSlotType timeSlotArg) { // check cases based on given time slot and add a time slot ID appropriately switch (timeSlotArg) { case TimeSlotType.Morning: return("1"); case TimeSlotType.Afternoon: return("2"); case TimeSlotType.Evening: return("3"); default: // print warning to console Debug.LogWarning("In GetTimeDayIdAppend(), invalid " + $"timeSlotArg: {timeSlotArg.ToString()}"); return("0"); } }
public void ChangeBackgroundL1FromHavenLocationEvent(string locationEventIdArg, TimeSlotType timeSlotArg) { ChangeBackground(AssetRefMethods.LoadBundleAssetHavenLocationEventDialogueBackground( locationEventIdArg, timeSlotArg), 1); }
public void ChangeBackgroundL1FromHavenLocationActivityHub(HavenLocation locationArg, TimeSlotType timeSlotArg) { ChangeBackground(AssetRefMethods.LoadBundleAssetHavenLocationActivityHubDialogueBackground( locationArg, timeSlotArg), 1); }
public void ChangeBackgroundL1FromHavenActivity(string havenActivityIdArg, TimeSlotType timeSlotArg) { ChangeBackground(AssetRefMethods.LoadBundleAssetHavenActivityDialogueBackground( havenActivityIdArg, timeSlotArg), 1); }