private IEnumerator Start_To_Pee() { current_happiness += 10; current_state = MeonState.Peeing; go_text.GetComponent<SpriteRenderer>().sprite = spr_peeing; yield return new WaitForSeconds(time_to_pee); go_urinal.GetUrinal().Unassign_Meon(); current_state = MeonState.Finished_peeing; current_happiness += 10; go_text.GetComponent<SpriteRenderer>().sprite = spr_finished_peeing; }
private IEnumerator Start_Washing_Hands() { current_happiness += 10; current_state = MeonState.Washing_hands; go_text.GetComponent<SpriteRenderer>().sprite = spr_washing_hands; yield return new WaitForSeconds(time_washing_hands); go_sink.GetSink().Unassign_Meon(); current_state = MeonState.Finished_washing; scr_movement.Move_Out_From_Scene(); current_happiness += 10; go_text.GetComponent<SpriteRenderer>().sprite = spr_finished_washing; }
private void Start() { current_happiness = initial_happiness; initial_pos = gameObject.transform.position; current_state = MeonState.Needs_to_pee; go_urinal = null; scr_movement = gameObject.GetComponent<Movement>(); scr_movement.Set_Meon(this); scr_anim = gameObject.GetComponent<Anim>(); scr_anim.Set_Meon(this); go_text = new GameObject("Text"); go_text.transform.parent = this.gameObject.transform; go_text.SetLocalPositionXY(0,30); spr_peeing = Resources.Load("Sprites/Text Boxes/spr_peeing", typeof(Sprite)) as Sprite; spr_needs_to_pee = Resources.Load("Sprites/Text Boxes/spr_needs_to_pee", typeof(Sprite)) as Sprite; spr_finished_peeing = Resources.Load("Sprites/Text Boxes/spr_finished_peeing", typeof(Sprite)) as Sprite; spr_washing_hands = Resources.Load("Sprites/Text Boxes/spr_washing_hands", typeof(Sprite)) as Sprite; spr_finished_washing = Resources.Load("Sprites/Text Boxes/spr_finished_washing", typeof(Sprite)) as Sprite; go_text.AddComponent<SpriteRenderer>().sprite = spr_needs_to_pee; go_text.GetComponent<SpriteRenderer>().sortingOrder = 2; }