public void UpdateJobUi() { if (JobManager.Instance.CurrentJob != null) { Job job = JobManager.Instance.CurrentJob; JobNameText.text = job.name; PaymentText.text = job.WagePerHour + "/Hour"; WorkingTimeText.text = System.TimeSpan.FromHours(job.JobStartingTimeInHours).Hours.ToString("00") + ":" + System.TimeSpan.FromHours(job.JobStartingTimeInHours).Minutes.ToString("00") + " - " + System.TimeSpan.FromHours(job.JobStartingTimeInHours + job.WorkingTimeInHours).Hours.ToString("00") + ":" + System.TimeSpan.FromHours(job.JobStartingTimeInHours + job.WorkingTimeInHours).Minutes.ToString("00"); WorkingDaysText.text = ""; foreach (int workingDay in job.WorkingDays) { WorkingDaysText.text += ((Calendar.Weekday)workingDay).ToString()[0]; } PerformanceSlider.value = job.GetPerformanceLevel(); JobIcon.sprite = JobIconSprites[job.jobType]; RequiredLevel.text = ""; ProgressLevel.text = ""; if (Stats.Initialized) { foreach (Skill.Type type in job.RequiredSkills.Keys) { RequiredLevel.text += "Level " + job.RequiredSkills[type].ToString() + " " + type.ToString() + "\n"; } //+ string.Join(", ", job.RequiredSkills); foreach (Skill.Type type in job.RequiredSkills.Keys) { ProgressLevel.text += Stats.Skill(type).CurrentLevel + "/" + job.RequiredSkills[type].ToString() + "\n"; } } CurrentEmplymentStatus.text = job.name; } else { JobNameText.text = "Unemployed"; PaymentText.text = "-"; WorkingTimeText.text = "-"; WorkingDaysText.text = "-"; RequiredLevel.text = ""; ProgressLevel.text = "-"; CurrentEmplymentStatus.text = "Unemployed"; } }
private IEnumerator PracticeWriting() { GameLibOfMethods.cantMove = true; GameLibOfMethods.canInteract = false; GameLibOfMethods.animator.SetBool("Sitting", true); GameLibOfMethods.doingSomething = true; float moodDrainSpeed = MoodDrainPerHour; float energyDrainSpeed = EnergyDrainPerHour; float xpGainSpeed = XpGainGetHour; yield return(new WaitForEndOfFrame()); while (!Input.GetKey(InteractionChecker.Instance.KeyToInteract) && !GameLibOfMethods.passedOut) { GameLibOfMethods.animator.SetBool("Learning", true); float multi = (Time.deltaTime / GameClock.Speed) * GameClock.TimeMultiplier; Stats.AddXP(Type.Writing, xpGainSpeed * multi); Stats.Remove(Status.Type.Energy, energyDrainSpeed * multi); Stats.Remove(Status.Type.Mood, moodDrainSpeed * multi); /*GameLibOfMethods.player.GetComponent<Rigidbody2D>().velocity = Vector3.zero; * * //blackScreen.CrossFadeAlpha(0, 1, false); * * GameLibOfMethods.facingDir = Vector2.left;*/ yield return(new WaitForEndOfFrame()); } PlayExitSound(); GameLibOfMethods.animator.SetBool("Learning", false); yield return(new WaitForEndOfFrame()); PlayerCommands.WalkBackToLastPosition(); //Debug.Log("cant browse, busy doing something else"); }
public void UpdateJobUi() { if (JobManager.Instance.CurrentJob != null) { Job job = JobManager.Instance.CurrentJob; JobNameText.text = job.name; PaymentText.text = "£" + job.WagePerHour + "/Hour"; WorkingTimeText.text = System.TimeSpan.FromHours(job.JobStartingTimeInHours).Hours.ToString("00") + ":" + System.TimeSpan.FromHours(job.JobStartingTimeInHours).Minutes.ToString("00") + " - " + System.TimeSpan.FromHours(job.JobStartingTimeInHours + job.WorkingTimeInHours).Hours.ToString("00") + ":" + System.TimeSpan.FromHours(job.JobStartingTimeInHours + job.WorkingTimeInHours).Minutes.ToString("00"); WorkingDaysText.text = ""; string[] WeekdayNames = System.Enum.GetNames(typeof(Calendar.Weekday)); string WorkingDaysNames = ""; foreach (Calendar.Weekday weekday in job.WorkingDays) { WorkingDaysNames += weekday.ToString(); } foreach (string name in WeekdayNames) { if (WorkingDaysNames.Contains(name)) { WorkingDaysText.text += name.ToString()[0] + " "; } else { WorkingDaysText.text += "<color=#9A0000><s>" + name.ToString()[0] + "</color></s> "; } } PerformanceSlider.value = job.GetPerformanceLevel(); JobIcon.sprite = JobIconSprites[job.jobType]; RequiredLevel.text = ""; ProgressLevel.text = ""; if (Stats.Initialized) { foreach (Skill.Type type in job.RequiredSkills.Keys) { RequiredLevel.text += "Level " + job.RequiredSkills[type].ToString() + " " + type.ToString() + "\n"; } //+ string.Join(", ", job.RequiredSkills); foreach (Skill.Type type in job.RequiredSkills.Keys) { ProgressLevel.text += Stats.Skill(type).CurrentLevel + "/" + job.RequiredSkills[type].ToString() + "\n"; } } CurrentEmplymentStatus.text = job.name; } else { JobNameText.text = "Unemployed"; PaymentText.text = "-"; WorkingTimeText.text = "-"; WorkingDaysText.text = "-"; RequiredLevel.text = ""; ProgressLevel.text = "-"; CurrentEmplymentStatus.text = "Unemployed"; } }