public override void OnLookupUpdate(string dataID, object value) { base.OnLookupUpdate(dataID, value); if (dataID != null && value != null) { string tmp = mDL.GetDefaultLookupData <string>(); if (HeadFrameStr == null || !HeadFrameStr.Equals(tmp)) { HeadFrameStr = tmp; if (HeadFrameIcon == null) { HeadFrameIcon = mDL.GetComponent <UISprite>(); } if (string.IsNullOrEmpty(HeadFrameStr)) { HeadFrameIcon.spriteName = string.Empty; } else { string[] split = HeadFrameStr.Split('_'); HeadFrame data = EconemyTemplateManager.Instance.GetHeadFrame(split[0], int.Parse(split[1])); HeadFrameIcon.spriteName = data.iconId; } } } }
public void SelectEvent(string id, int num, bool isLock) { Id = id; Num = num; HeadFrame data = EconemyTemplateManager.Instance.GetHeadFrame(Id, Num); if (string.IsNullOrEmpty(headFrameStr) || string.IsNullOrEmpty(CurId)) { DataLookupsCache.Instance.SearchDataByID <string>("user.headFrame", out headFrameStr); if (string.IsNullOrEmpty(headFrameStr)) { headFrameStr = "0_0"; } CurId = data.id; CurNum = data.num; } HeadFrameNameLabel.text = data.name; HeadFrameDescLabel.text = data.desc; HeadFrameIcon.spriteName = data.iconId; if (isLock) { UseBtn.GetComponent <UISprite>().color = Color.magenta; UseBtn.GetComponent <BoxCollider>().enabled = false; UseBtnLabel.text = EB.Localizer.GetString("ID_PARTNER_AWAKEN_BTN_1"); } else if (Id.Equals(CurId) && Num == CurNum) { UseBtn.GetComponent <UISprite>().color = Color.magenta; UseBtn.GetComponent <BoxCollider>().enabled = false; UseBtnLabel.text = EB.Localizer.GetString("ID_PARTNER_AWAKEN_BTN_2"); } else { UseBtn.GetComponent <UISprite>().color = Color.white; UseBtn.GetComponent <BoxCollider>().enabled = true; UseBtnLabel.text = EB.Localizer.GetString("ID_SMALLPARTNER_USE"); } InitItems(); }