string GetOutputIcon(long combine_id_) { ConfCombineFormula data = ConfCombineFormula.Get(combine_id_); long out_put_id = data.outputId; if (0 == out_put_id) { return(null); } switch ((ENUM_COMBINE_TYPE)data.type) { case ENUM_COMBINE_TYPE.POLICE: { return(ConfOfficer.Get(ConfProp.Get(out_put_id).officerId).icon); } case ENUM_COMBINE_TYPE.COLLECTION: case ENUM_COMBINE_TYPE.OTHER: { return(ConfProp.Get(out_put_id).icon); } default: break; } return(null); }
private void MoveStopped(int select_index_) { m_police_name.Text = LocalizeModule.Instance.GetString(ConfOfficer.Get(m_officers[select_index_].OfficerId).name); m_skill_label.Text = LocalizeModule.Instance.GetString(ConfOfficer.Get(m_officers[select_index_].OfficerId).descs); m_police_name.Visible = true; m_skill_icon.Visible = true; m_skill_label.Visible = true; this.m_send_btn.Visible = true; //Debug.Log("========================" + select_index_); string icon, desc; if (SkillUtil.GetCurLevelSkillIconAndDesc(m_officers[select_index_].OfficerId, m_officers[select_index_].Level, out icon, out desc)) { m_skill_icon.Sprite = icon; m_skill_label.Text = desc; } if (m_selected_IDs.Contains(m_officers[select_index_].OfficerId)) { this.m_send_btn.SetGray(true); this.m_send_btn.Enable = false; } else { GameEvents.UI_Guid_Event.OnSelectPolice.SafeInvoke(select_index_); this.m_send_btn.SetGray(false); this.m_send_btn.Enable = true; } RefreshNum(select_index_ + 1); }
public void OnEnterLocalSceneByID(int sceneID, IList <long> sceneExhibits, IList <long> taskExhibits, bool needPolice) { TryCreateGameScene(sceneID); int totalTime = 0; IList <long> polices = new List <long>(); #if OFFICER_SYS if (needPolice) { polices = PoliceDispatchManager.Instance.GetAllDispathOfficersID(); for (int i = 0; i < polices.Count; i++) { ConfOfficer confPolice = ConfOfficer.Get(polices[i]); if (confPolice == null) { continue; } totalTime += confPolice.secondGain; } } else { totalTime = 18000; //30分钟 } #endif TimeModule.Instance.SetTimeout(() => { OnPrepareScene(); (this.m_currentScene as GameSceneBase).InitScene(this.m_sceneData, sceneExhibits, taskExhibits, polices, totalTime); }, 0.5f); }
public static int GetOfficerVitCost(long officer_id_, int lvl_) { ConfOfficer officer = ConfOfficer.Get(officer_id_); int base_vit_cost = officer.vitConsume; int delta_vit = officer.upGainSceneVit; return(base_vit_cost + (lvl_ - 1) * delta_vit); }
public static int GetOfficerTimeAddition(long officer_id_, int lvl_) { ConfOfficer officer = ConfOfficer.Get(officer_id_); int base_time_addition = officer.secondGain; int delta_time = officer.upGainSceneSceond; return(base_time_addition + (lvl_ - 1) * delta_time); }
public static string GetPoliceIconByIndex(int idx_) { long officer_id; if (EventGameManager.Instance.GetOfficerIdByIndex(idx_, out officer_id)) { return(ConfOfficer.Get(officer_id).icon); } return(null); }
public void Refresh(long officer_id_) { m_officer_id = officer_id_; ConfOfficer info = ConfOfficer.Get(officer_id_); m_head_tex.TextureName = info.portrait; m_name_txt.Text = LocalizeModule.Instance.GetString(info.name); m_name_txt.color = PoliceUILogicAssist.GetPoliceQualityColor(info.quality); Occupied(true); }
private static long GetCurLevelSkillID(long officer_id_, int lvl_) { lvl_ = 0 == lvl_ ? 1 : lvl_; int cur_level = lvl_; ConfOfficer exl_data = ConfOfficer.Get(officer_id_); long skill_id = -1; switch (cur_level) { case 1: skill_id = exl_data.skillId; break; case 2: skill_id = exl_data.level2SkillId; break; case 3: skill_id = exl_data.level3SkillId; break; case 4: skill_id = exl_data.level4SkillId; break; case 5: skill_id = exl_data.level5SkillId; break; case 6: skill_id = exl_data.level6SkillId; break; case 7: skill_id = exl_data.level7SkillId; break; case 8: skill_id = exl_data.level8SkillId; break; case 9: skill_id = exl_data.level9SkillId; break; case 10: skill_id = exl_data.level10SkillId; break; } return(skill_id); }
public static int OfficerCompare(OfficerInfo a, OfficerInfo b) { if (a.OfficerId == b.OfficerId) { return(0); } if (a.Level > 0 && 0 == b.Level) { return(-1); } else if (0 == a.Level && b.Level > 0) { return(1); } else { if (ConfOfficer.Get(a.OfficerId).quality > ConfOfficer.Get(b.OfficerId).quality) { return(-1); } else if (ConfOfficer.Get(a.OfficerId).quality < ConfOfficer.Get(b.OfficerId).quality) { return(1); } else { if (a.Level > b.Level) { return(-1); } else if (a.Level < b.Level) { return(1); } else { if (a.OfficerId < b.OfficerId) { return(-1); } else if (a.OfficerId > b.OfficerId) { return(1); } else { return(-1); } } } } }
public static List <long> GetPoliceKeyWordByOfficerID(long officer_id_) { List <long> ret = new List <long>(); ConfOfficer confOfficer = ConfOfficer.Get(officer_id_); for (int i = 0; i < confOfficer.features.Length; i++) { ret.Add(confOfficer.features[i]); } return(ret); }
public static List <string> GetPoliceKeyWordIconsByOfficerID(long officer_id_) { List <string> ret = new List <string>(); ConfOfficer confOfficer = ConfOfficer.Get(officer_id_); for (int i = 0; i < confOfficer.features.Length; i++) { int word_id = confOfficer.features[i]; string word_str = LocalizeModule.Instance.GetString(ConfKeyWords.Get(word_id).icon); ret.Add(word_str); } return(ret); }
public void PreloadLastestDispatchOffers() { List <long> latestDispatchOffers = GetAllDispathOfficersID(); for (int i = 0; i < latestDispatchOffers.Count; ++i) { string dispatchOfferImage = ConfOfficer.Get(latestDispatchOffers[i]).portrait; if (!string.IsNullOrEmpty(dispatchOfferImage)) { ResourceModule.Instance.PreloadAsset(dispatchOfferImage, null); } } }
public static void GetFeedBackAndDialogue(long officer_id_, long phase_id_, int valuation_, out string feedback_, out string dialogue_) { officer_id_ = 0 == officer_id_ ? 101 : officer_id_; string temp_feedback = 0 == valuation_?ConfEventPhase.Get(phase_id_).normaFeedback : ConfEventPhase.Get(phase_id_).successFeedback; string temp_dialogue = 0 == valuation_?ConfEventPhase.Get(phase_id_).normalDialogue : ConfEventPhase.Get(phase_id_).successDialogue; string officer_name = LocalizeModule.Instance.GetString(ConfOfficer.Get(officer_id_).name); feedback_ = LocalizeModule.Instance.GetString(temp_feedback); feedback_ = ExchangeKeyWords(feedback_, officer_name); dialogue_ = LocalizeModule.Instance.GetString(temp_dialogue); dialogue_ = ExchangeKeyWords(dialogue_, officer_name); }
private void PlayTalk(long officer_id_, long phase_id_, int valuation) { m_desc_root.Visible = true; if (0 != officer_id_) { m_officer_tex.TextureName = ConfOfficer.Get(officer_id_).hollowPortrait; } else { m_officer_tex.TextureName = CommonData.GetBigPortrait(GlobalInfo.MY_PLAYER_INFO.PlayerIcon); } string t_feedback, t_dialogue; EventGameUIAssist.GetFeedBackAndDialogue(officer_id_, phase_id_, valuation, out t_feedback, out t_dialogue); m_desc_txt.Text = t_dialogue; }
public void AddOfficerInfo(long officerId) { OfficerInfo officerInfo = new OfficerInfo(); officerInfo.PlayerOfficerId = officerId * 100; officerInfo.OfficerId = officerId; officerInfo.Level = 1; ConfOfficer confOfficer = ConfOfficer.Get(officerId); officerInfo.Outsight = confOfficer.outsight; officerInfo.WillPower = confOfficer.willpower; officerInfo.Attention = confOfficer.attention; officerInfo.Memory = confOfficer.memory; officerInfo.VitConsume = confOfficer.vitConsume; officerInfo.SecondGain = confOfficer.secondGain; AddOfficerInfo(officerInfo); //officerInfo.Outsight }
private void RefreshOfficerView() { //if (m_officer_timestamp != GlobalInfo.MY_PLAYER_INFO.OfficerTimestamp) List <OfficerInfo> temp = GlobalInfo.MY_PLAYER_INFO.Officer_infos; if (0 != PlayerInfoManager.Instance.LimitNum) { temp = temp.GetRange(0, PlayerInfoManager.Instance.LimitNum); } if (m_officers.Count != temp.Count) { m_officers = temp; m_officer_timestamp = GlobalInfo.MY_PLAYER_INFO.OfficerTimestamp; int police_num = m_officers.Count; this.m_police_item_pool.EnsureSize <CustomPoliceItem>(police_num); for (int i = 0; i < police_num; ++i) { OfficerInfo info = m_officers[i]; var item = this.m_police_item_pool.GetChild <CustomPoliceItem>(i); item.OfficerID = info.OfficerId; item.InitTex(ConfOfficer.Get(info.OfficerId).portrait); item.InitMaterial(); item.gameObject.name = i.ToString(); } List <BlurGrayTexture> polices = new List <BlurGrayTexture>(); for (int i = 0; i < this.m_police_item_pool.ChildCount; ++i) { polices.Add(this.m_police_item_pool.GetChild <CustomPoliceItem>(i).Police_head_tex); } this.m_curve_move_panel.InitCustomItems(polices); RefreshNum(1); } }
protected override void InitCarryBase() { OfficerInfo officerInfo = GlobalInfo.MY_PLAYER_INFO.GetOfficerInfoByPlayId(m_carryID); ConfOfficer confOffice = ConfOfficer.Get(officerInfo.OfficerId); if (confOffice != null) { m_skillID = SkillTools.GetSkillIdByLevel(confOffice, officerInfo.Level); ConfSkill confSkill = ConfSkill.Get(m_skillID); if (confSkill != null) { if (confSkill.phase == 3) { GameSkillManager.Instance.m_hasPoliceAddition = true; } } MessageHandler.RegisterMessageHandler(MessageDefine.SCSkillTimerEmitResp, OnRes); base.InitCarryBase(); } }
public void Refresh(OfficerInfo info, Action <long> OnSelected_, ENUM_SEARCH_MODE mode_) { m_info = info; m_on_selected = OnSelected_; ConfOfficer officer_data = ConfOfficer.Get(info.OfficerId); m_tex.TextureName = officer_data.portrait; m_name_txt.Text = LocalizeModule.Instance.GetString(officer_data.name); m_name_txt.color = PoliceUILogicAssist.GetPoliceQualityColor(officer_data.quality); if (ENUM_SEARCH_MODE.E_SEARCH_ROOM == mode_) { m_skill_root.Visible = true; m_keyword_root.Visible = false; m_lvl_icon.Sprite = PoliceUILogicAssist.GetPoliceRankIcon(info.Level); string icon, desc; if (SkillUtil.GetCurLevelSkillIconAndDesc(info.OfficerId, info.Level, out icon, out desc)) { m_skill_lvl_txt.Text = info.Level.ToString(); m_skill_icon.Sprite = icon; m_skill_desc_txt.Text = desc; } } else if (ENUM_SEARCH_MODE.E_EVENTGAME == mode_) { m_skill_root.Visible = false; m_keyword_root.Visible = true; m_lvl_icon.Sprite = PoliceUILogicAssist.GetPoliceRankIcon(info.Level); List <long> keywords_id = EventGameUIAssist.GetPoliceKeyWordByOfficerID(info.OfficerId); m_keyword_grid.EnsureSize <EventGameKeywordItemView>(keywords_id.Count); for (int i = 0; i < m_keyword_grid.ChildCount; ++i) { m_keyword_grid.GetChild <EventGameKeywordItemView>(i).Refresh(i, keywords_id[i]); m_keyword_grid.GetChild <EventGameKeywordItemView>(i).Visible = true; } } }
void ShowOutputContent(long combine_id_) { long out_put_id = ConfCombineFormula.Get(combine_id_).outputId; if (0 == out_put_id) { return; } switch (m_combine_type) { case ENUM_COMBINE_TYPE.POLICE: { m_tex_view.TextureName = ConfOfficer.Get(ConfProp.Get(out_put_id).officerId).hollowPortrait; } break; case ENUM_COMBINE_TYPE.COLLECTION: { m_3D_view.Refresh(ConfProp.Get(out_put_id).exhibit); //m_3D_view.Refresh(Confexhibit.Get(out_put_id).assetName); //int ret = UnityEngine.Random.Range(1, 3); //m_3D_view.Refresh(0 == ret % 2 ? "FaYuanWai_01_MoTuoChe_01.prefab" : "G_BaoLuoGongZuoShi_01_gangtiexia_01.prefab"); } break; case ENUM_COMBINE_TYPE.OTHER: { m_icon_view.Sprite = ConfProp.Get(out_put_id).icon; } break; default: break; } }
public void Refresh(long officer_id_, bool checked_, Action <long, bool> Clicked_) { Officer_id = officer_id_; m_clicked_event = Clicked_; m_officer_portrait.TextureName = ConfOfficer.Get(officer_id_).portrait; List <string> key_word_icons = EventGameUIAssist.GetPoliceKeyWordIconsByOfficerID(officer_id_); m_grid.EnsureSize <GameImage>(key_word_icons.Count); for (int i = 0; i < m_grid.ChildCount; ++i) { var item = m_grid.GetChild <GameImage>(i); item.Sprite = key_word_icons[i]; item.Visible = true; } m_toggle.Checked = checked_; m_mask.Visible = false; m_effect.EffectPrefabName = $"UI_jingyuanpaiqian_pinzhi0{ConfOfficer.Get(officer_id_).quality}.prefab"; m_effect.Visible = true; }
public static bool GetCurLevelSkillIconAndDesc(long officer_id_, int lvl_, out string icon_, out string desc_) { icon_ = string.Empty; desc_ = string.Empty; lvl_ = 0 == lvl_ ? 1 : lvl_; int cur_level = lvl_; ConfOfficer exl_data = ConfOfficer.Get(officer_id_); long skill_id = -1; switch (cur_level) { case 1: skill_id = exl_data.skillId; break; case 2: skill_id = exl_data.level2SkillId; break; case 3: skill_id = exl_data.level3SkillId; break; case 4: skill_id = exl_data.level4SkillId; break; case 5: skill_id = exl_data.level5SkillId; break; case 6: skill_id = exl_data.level6SkillId; break; case 7: skill_id = exl_data.level7SkillId; break; case 8: skill_id = exl_data.level8SkillId; break; case 9: skill_id = exl_data.level9SkillId; break; case 10: skill_id = exl_data.level10SkillId; break; } if (skill_id > 0) { ConfSkill skill = ConfSkill.Get(skill_id); icon_ = skill.icon; desc_ = LocalizeModule.Instance.GetString(skill.descs); return(true); } return(false); }