public override void Awake() { base.Awake(); m_Instance = this; var t = mDMono.transform; Icon = t.GetComponent <DynamicUISprite>("TopLayout/TargetIcon/Icon"); NameLabel = t.GetComponent <UILabel>("TopLayout/TargetIcon/Name"); NumLabel = t.GetComponent <UILabel>("TopLayout/TargetIcon/NumLabel"); ItemContent = t.GetComponent <UILabel>("BagWindow/Text"); UseItem = t.FindEx("Buttons/Use").gameObject; CompoundItem = t.FindEx("Buttons/compound").gameObject; SourceItem = t.FindEx("Buttons/Source").gameObject; BtnGrid = t.GetComponent <UIGrid>("Buttons"); Border = t.GetComponent <UISprite>("TopLayout/TargetIcon/Border"); FrameBG = t.GetComponent <UISprite>("TopLayout/TargetIcon/FrameBG"); mEquipSuitIcon = t.GetComponent <DynamicUISprite>("TopLayout/TargetIcon/EquipSuitIcon"); mEquipLevelBG = t.GetComponent <UISprite>("TopLayout/TargetIcon/EquipLevel/Sprite"); mEquipLevel = t.GetComponent <UILabel>("TopLayout/TargetIcon/EquipLevel"); mEuqipLevelShadow = t.GetComponent <UILabel>("TopLayout/TargetIcon/EquipLevel/LabelShadow"); CurType = 0; TextBG = t.FindEx("Sprite").gameObject; mClipFlag = t.FindEx("TopLayout/TargetIcon/Flag").gameObject; mboxGradeNumLab = t.GetComponent <UILabel>("TopLayout/TargetIcon/BoxGradeNum"); mUseRequest = t.GetComponent <UIServerRequest>("Buttons/Use"); mCompoundRequest = t.GetComponent <UIServerRequest>("Buttons/compound"); dataLookup = t.GetDataLookupILRComponent <ItemUseDataLookup>(); t.GetComponent <UIButton>("Buttons/Use").onClick.Add(new EventDelegate(OnUseButtonClick)); t.GetComponent <UIButton>("Buttons/compound").onClick.Add(new EventDelegate(OnCompoundButtonClick)); t.GetComponent <UIButton>("Buttons/Source").onClick.Add(new EventDelegate(OnSourceButtonClick)); t.GetComponent <UIServerRequest>("Buttons/Use").onResponse.Add(new EventDelegate(mDMono, "OnFetchData")); t.GetComponent <UIServerRequest>("Buttons/compound").onResponse.Add(new EventDelegate(mDMono, "OnFetchData")); var parent = t.parent.parent; parent.GetComponent <UIButton>("UpButtons/Title/BtnList/AllBtn").onClick.Add(new EventDelegate(() => SelectBagItems(parent.FindEx("UpButtons/Title/BtnList/AllBtn").gameObject))); parent.GetComponent <UIButton>("UpButtons/Title/BtnList/ConsumablesBtn").onClick.Add(new EventDelegate(() => SelectBagItems(parent.FindEx("UpButtons/Title/BtnList/ConsumablesBtn").gameObject))); parent.GetComponent <UIButton>("UpButtons/Title/BtnList/EquipmentBtn").onClick.Add(new EventDelegate(() => SelectBagItems(parent.FindEx("UpButtons/Title/BtnList/EquipmentBtn").gameObject))); parent.GetComponent <UIButton>("UpButtons/Title/BtnList/PartnersBtn").onClick.Add(new EventDelegate(() => SelectBagItems(parent.FindEx("UpButtons/Title/BtnList/PartnersBtn").gameObject))); parent.GetComponent <UIButton>("UpButtons/Title/BtnList/MaterialsBtn").onClick.Add(new EventDelegate(() => SelectBagItems(parent.FindEx("UpButtons/Title/BtnList/MaterialsBtn").gameObject))); }
public override void OnDestroy() { m_Instance = null; }