void sleepFriendTapped(System.Object sender, System.EventArgs e) { friend.giveSleep(); hunger -= 0.013; HungerBar.ProgressTo(hunger, 400, Easing.Linear); energy += 0.019; EnergyBar.ProgressTo(energy, 400, Easing.Linear); mood += 0.016; MoodBar.ProgressTo(mood, 400, Easing.Linear); if (health < 100) { health += 10; } HealthLabel.Text = health.ToString(); ResetTimer(); updateUI(); }
void AddEmployee(Employee employee, MoodBar moodBar) { GameObject go = Instantiate(Pref, moodBar.EmployeeList.transform); Sprite job = employee.Code; switch (employee.job) { case Job.Code: job = employee.Code; break; case Job.Art: job = employee.Art; break; case Job.QA: job = employee.QA; break; } go.GetComponent <Image>().sprite = job; }
void partyFriendTapped(System.Object sender, System.EventArgs e) { friend.giveParty(); hunger -= 0.013; HungerBar.ProgressTo(hunger, 400, Easing.Linear); energy -= 0.01; EnergyBar.ProgressTo(energy, 400, Easing.Linear); mood += 0.019; MoodBar.ProgressTo(mood, 400, Easing.Linear); if (health > 0) { health -= 2; } else if (health == 0) { DisplayAlert("Healt declined!", "Your friend is sick.", "Start over"); } HealthLabel.Text = health.ToString(); ResetTimer(); updateUI(); }