public void Set(PhoneEntity pe) { Item = pe; switch (pe.Type) { case TypePhoneEntity.People: { Label.text = pe.Text; Icon.spriteName = "UI_jiteli_n"; Sp.color = Color1; } break; case TypePhoneEntity.Engineer: { Label.text = pe.Text; Icon.spriteName = "UI_rss_n"; Sp.color = Color2; } break; case TypePhoneEntity.PublicPerson: { Label.text = pe.Text; Icon.spriteName = "icon_phone"; Sp.color = Color3; } break; } var rect = Icon.GetAtlasSprite().inner; Icon.transform.localScale = new Vector3(rect.width, rect.height); Label.text += "\nСтоимость работ: " + pe.Price; Background.gameObject.SetActive(false); }
private IEnumerator StartRandomSocial(SocialEntity social, PhoneEntity pes) { yield return new WaitForSeconds(5); if (isRunSocial) { GameControllerLevel2.Instance.PhoneEntities.Remove(pes); BaseGUI.instance.ClosePhone(); if (!BaseGUI.instance.IsTrainingNow) { GameControllerLevel2.Instance.HouseActionSocial.StartSocialEntity(social); } switch (social.Room) { case RoomType.OutHouse: { if (GameControllerLevel2.Instance.Outhouse.gameObject.activeSelf) { GameControllerLevel2.Instance.Outhouse.StartSocialEntity(social); } } break; } } }
private void PreStartRandomSocial() { var social = RandomLogic.GetRandomElement(SocialEntityTableJeka2.List); if (!GameControllerLevel2.Instance.HouseTechnology.IsRunSocial(social.Technology)) { return; } var pes = new Assets.Scripts.Entities.Logic.PhoneEntity { IdObj = social.Id, Price = 1000, Text = social.TextPhone, Type = TypePhoneEntity.Engineer }; GameControllerLevel2.Instance.PhoneEntities.Add(pes); UIScript.Instance.PhoneCount = GameControllerLevel2.Instance.PhoneEntities.Count; BaseGUI.instance.OnPhonePopup(); isRunSocial = true; GameControllerLevel2.Instance.StartCoroutine(StartRandomSocial(social, pes)); }