public override void Awake() { base.Awake(); var t = controller.transform; mName = t.GetComponent <UILabel>("DataPanel/Item/Name"); mNumLabel = t.GetComponent <UILabel>("DataPanel/Item/Num"); mUseNumLabel = t.GetComponent <UILabel>("DataPanel/Use/Adjust/UseNum"); mIcon = t.GetComponent <DynamicUISprite>("DataPanel/Item/Icon"); mFrame = t.GetComponent <UISprite>("DataPanel/Item/Icon/LvlBorder"); mFrameBG = t.GetComponent <UISprite>("DataPanel/Item/Icon/FrameBG"); mReduceBtnMask = t.FindEx("DataPanel/Use/Adjust/Reduce/ReduceMask").gameObject; mAddBtnMask = t.FindEx("DataPanel/Use/Adjust/Add/AddMask").gameObject; mReduceBtn = t.GetComponent <UIButton>("DataPanel/Use/Adjust/Reduce"); mAddBtn = t.GetComponent <UIButton>("DataPanel/Use/Adjust/Add"); mUseBtn = t.GetComponent <UIButton>("DataPanel/Use/OkUse"); mMaxBtn = t.GetComponent <UIButton>("DataPanel/Use/Adjust/Max"); mUseRequest = t.GetComponent <UIServerRequest>("DataPanel/Use"); dataLookup = t.GetDataLookupILRComponent <ItemUseDataLookup>(); mEquipSuitIcon = t.GetComponent <DynamicUISprite>("DataPanel/Item/Icon/EquipSuitIcon"); mboxGradeNumLab = t.GetComponent <UILabel>("DataPanel/Item/Icon/BoxGradeNum"); controller.backButton = t.GetComponent <UIButton>("DataPanel/CloseBtn"); mMaxBtn.onClick.Add(new EventDelegate(OnMaxClick)); mUseBtn.onClick.Add(new EventDelegate(OnUse)); t.GetComponent <ContinuePressTrigger>("DataPanel/Use/Adjust/Reduce").m_CallBackPress.Add(new EventDelegate(OnReduceClick)); t.GetComponent <ContinuePressTrigger>("DataPanel/Use/Adjust/Add").m_CallBackPress.Add(new EventDelegate(OnAddClick)); t.GetComponent <UIServerRequest>("DataPanel/Use").onResponse.Add(new EventDelegate(controller, "OnFetchData")); }
protected void FetchDataRemote(UIServerRequest serverRequest) { if (serverRequest != null) { LoadingSpinner.Show(); serverRequest.SendRequest(); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); UIServerRequest request = target as UIServerRequest; NGUIEditorTools.DrawEvents("On Send", request, request.onSendRequest, false); NGUIEditorTools.DrawEvents("On Response", request, request.onResponse, false); }
public override void Awake() { base.Awake(); var t = mDMono.transform; _controllerILR = t.GetComponentInParent <UIControllerILR>(); Transform store_root = _controllerILR.transform; m_Scroll = store_root.GetMonoILRComponent <UIStoreGridScroll>("Store/NewBlacksmithView/BlacksmithViews/Shared/SlotsContainer/Placeholder/Grid"); m_GetDataRequest = t.GetComponent <UIServerRequest>("Extra/Get"); m_RefreshRequest = t.GetComponent <UIServerRequest>("Extra/Refresh"); m_BuyRequest = store_root.GetComponent <UIServerRequest>("Store/NewBlacksmithView/BlacksmithViews/Shared/Extra/Buy"); RefreshBtnRoot = store_root.GetComponent <UIButton>("Store/BGs/Bottom/Button", false); RefreshCostLabel = store_root.GetComponent <UILabel>("Store/BGs/Bottom/Button/Cost/Diamand/Label", false); m_RefreshTimeLabel = store_root.GetComponent <UILabel>("Store/BGs/Bottom/RefreshTime", false); RefreshCostSprite = store_root.GetComponent <UISprite>("Store/BGs/Bottom/Button/Cost/Diamand/Sprite", false); NewCurrencyCommonLabel = store_root.GetComponent <UILabel>("UINormalFrameBG/NewCurrency/Table/1_Common/Label"); NewCurrencyCommonSprite = store_root.GetComponent <UISprite>("UINormalFrameBG/NewCurrency/Table/1_Common/Icon"); RefreshFxObj = store_root.FindEx("Store/NewBlacksmithView/BlacksmithViews/Shared/Fx").gameObject; UIServerRequestHotFix mysGetRequest = t.GetMonoILRComponent <UIServerRequestHotFix>("Extra/Get"); mysGetRequest.response = OnRequestStoreData; t.GetComponent <UIServerRequest>("Extra/Get").onResponse.Add(new EventDelegate(mysGetRequest.mDMono, "OnFetchData")); UIServerRequestHotFix mysRefreshRequest = t.GetMonoILRComponent <UIServerRequestHotFix>("Extra/Refresh"); mysRefreshRequest.response = OnRefresh; t.GetComponent <UIServerRequest>("Extra/Refresh").onResponse.Add(new EventDelegate(mysRefreshRequest.mDMono, "OnFetchData")); UIServerRequestHotFix buyRequest = t.parent.GetMonoILRComponent <UIServerRequestHotFix>("Shared/Extra/Buy"); if (buyRequest.response == null) { buyRequest.response = OnBuy; t.parent.GetComponent <UIServerRequest>("Shared/Extra/Buy").onResponse.Add(new EventDelegate(buyRequest.mDMono, "OnFetchData")); } m_DataID = mDMono.StringParamList[0]; m_StoreType = mDMono.StringParamList[1]; m_StoreName = mDMono.StringParamList[2]; m_StoreId = mDMono.IntParamList[0]; m_Columns = mDMono.IntParamList[1]; CronRefreshExcuter re = CreateShopRefresher(); AutoRefreshingManager.Instance.AddCronRefreshExcuter(re); }
private void InitView() { mDL.DataIDList.Add("user_prize_data.taskacm"); m_ChestRoot = mDL.transform.Find("AchievementReward").gameObject; m_ProgressLabel = mDL.transform.Find("AchievementReward/ProgressBar/Label").GetComponent <UILabel>(); m_AchievementProgressBar = mDL.transform.Find("AchievementReward/ProgressBar").GetComponent <UIProgressBar>(); m_ReceiveChestRequest = mDL.transform.Find("AchievementReward/ReceiveChestReq").GetComponent <UIServerRequest>(); m_ReceiveChestRequest.onResponse.Add(new EventDelegate(mDL, "OnFetchData")); UIButton HotfixBtn0 = mDL.transform.Find("AchievementReward/Box").GetComponent <UIButton>(); HotfixBtn0.onClick.Add(new EventDelegate(OnChestClick)); m_Chest = new GameChest(); m_Chest.Open = mDL.transform.Find("AchievementReward/Box/OpenTag").gameObject; m_Chest.UnOpen = mDL.transform.Find("AchievementReward/Box/Close").gameObject; m_Chest.Light = mDL.transform.Find("AchievementReward/Box/Light").gameObject; }
public override void Awake() { base.Awake(); SelfRankLabel = mDMono.transform.parent.GetComponent <UILabel>("LeftTopHold/SelfServerRankOrder"); AllRankLabel = mDMono.transform.parent.GetComponent <UILabel>("LeftTopHold/AllServerRankOrder"); OnHookincomeLabel = mDMono.transform.parent.GetComponent <UILabel>("LeftTopHold/OnHookincomeLabel"); categoryTabs = mDMono.transform.GetMonoILRComponent <UIConditionTabController>("ContentView"); categoryTabs.TabLibPrefabs = new List <UITabControllerHotFix.TabLibEntry>(); gridScroll = mDMono.transform.GetMonoILRComponent <HonorRankGridScroll>( "ContentView/Views/Scroll View/Placeholder/Grid"); selfRequest = mDMono.transform.GetComponent <UIServerRequest>("ContentView/UpButtons/ButtonGrid/1_Self/Self"); selfRequest.onResponse.Add(new EventDelegate(mDMono, "OnFetchData")); allRequest = mDMono.transform.GetComponent <UIServerRequest>("ContentView/UpButtons/ButtonGrid/0_All/All"); allRequest.onResponse.Add(new EventDelegate(mDMono, "OnFetchData")); HonorArenaRankNeedReq(); Init(); Messenger.AddListener(EventName.HonorArenaRankNeedReq, HonorArenaRankNeedReq); }
public override void Awake() { base.Awake(); var t = controller.transform; BuyTimesRequest = t.GetComponent <UIServerRequest>("BuyTimes"); RollRequest = t.GetComponent <UIServerRequest>("GetRollInfo"); GetInfoRequest = t.GetComponent <UIServerRequest>("GetInfo"); AttackTimesLabel = t.GetComponent <UILabel>("Center/PutRewardView/AtkBtn/TimeLabel"); AttackBtn = t.GetComponent <UIButton>("Center/PutRewardView/AtkBtn"); NodeRewardList = new List <LTWorldBossNodeRewardLogic>(); NodeRewardList.Add(t.GetMonoILRComponent <LTWorldBossNodeRewardLogic>("Center/PutRewardView/PutReward/Item")); NodeRewardList.Add(t.GetMonoILRComponent <LTWorldBossNodeRewardLogic>("Center/PutRewardView/PutReward/Item (1)")); NodeRewardList.Add(t.GetMonoILRComponent <LTWorldBossNodeRewardLogic>("Center/PutRewardView/PutReward/Item (2)")); NameLabel = t.GetComponent <UILabel>("Center/BossInfo/NameLabel"); TypeSprite = t.GetComponent <UISprite>("Center/BossInfo/NameLabel/Sprite"); OpenTimeLabel = t.GetComponent <UILabel>("Edge/Bottom"); mMaxTime = 60f; LobbyTexture = t.GetComponent <UITexture>("Center/BossInfo/Lobby"); controller.backButton = t.GetComponent <UIButton>("Edge/TopLeft/CancelBtn"); t.GetComponent <UIButton>("Edge/TopLeft/Notice").onClick.Add(new EventDelegate(OnRuleBtnClick)); var uiWorldBossRankLogic = t.GetDataLookupILRComponent <UIWorldBossRankLogic>("Edge/Right/LTWorldBossRankView"); t.GetComponent <UIButton>("Edge/NewCurrency/BtnList/PreviewBtn").onClick.Add(new EventDelegate(uiWorldBossRankLogic.OnRewardBtnClick)); t.GetComponent <UIButton>("Edge/NewCurrency/BtnList/RankListBtn").onClick.Add(new EventDelegate(uiWorldBossRankLogic.OnRankBtnClick)); t.GetComponent <UIButton>("Edge/NewCurrency/BtnList/ReadyBtn").onClick.Add(new EventDelegate(uiWorldBossRankLogic.OnBattleReadyBtnClick)); t.GetComponent <UIButton>("Edge/Right/LTWorldBossRankView/Rank/CancelBtn").onClick.Add(new EventDelegate(uiWorldBossRankLogic.OnRankCancelBtnClick)); t.GetComponent <UIButton>("Center/PutRewardView/AtkBtn").onClick.Add(new EventDelegate(OnAtkBtnClick)); t.GetComponent <UIServerRequest>("GetInfo").onResponse.Add(new EventDelegate(controller, "OnFetchData")); t.GetComponent <UIServerRequest>("BuyTimes").onResponse.Add(new EventDelegate(controller, "OnFetchData")); t.GetComponent <UIServerRequest>("GetRollInfo").onResponse.Add(new EventDelegate(controller, "OnFetchData")); Messenger.AddListener(Hotfix_LT.EventName.BossDieEvent, OnBossDieFunc); }
// Use this for initialization public override void Start() { m_UIServerRequest = mDMono.GetComponent <UIServerRequest>(); if (m_UIServerRequest != null) { m_UIServerRequest.onResponse.Add(new EventDelegate(mDMono, "OnFetchData")); } else { EB.Debug.LogError("Didnot have UIServerRequest In this object{0}", mDMono.name); } if (NeedRefreshData()) { FetchDataRemote(); } else { FetchDataLocalAndShow(); } }
public override void Awake() { base.Awake(); var t = mDMono.transform; RewardItem = t.GetMonoILRComponent <LTShowItem>("LTShowItem"); DescLabel = t.GetComponent <UILabel>("Dice/DescLabel"); NumLabel = t.GetComponent <UILabel>("Dice/NumLabel"); DiceSprite = t.GetComponent <UISprite>("Dice/ClickBtn"); DiceServerRequest = t.GetComponent <UIServerRequest>("Dice/ClickBtn"); RewardServerRequest = t.GetComponentEx <UIServerRequest>(); MaxNameLabel = t.GetComponent <UILabel>("NameLabel"); MaxNumLabel = t.GetComponent <UILabel>("NumLabel"); LockObj = t.FindEx("Dice/LockSprite").gameObject; TipLabel = t.GetComponent <UILabel>("TipLabel"); t.GetComponent <UIButton>("Dice/ClickBtn").onClick.Add(new EventDelegate(OnDiceBtnClick)); t.GetComponent <UIServerRequest>("Dice/ClickBtn").onResponse.Add(new EventDelegate(mDMono, "OnFetchData")); Hotfix_LT.Messenger.AddListener(Hotfix_LT.EventName.OnMaxRollUpdate, OnMaxRollUpdateFunc); mTweenAlpha = t.GetComponentEx <TweenAlpha>(); }
public override void Awake() { base.Awake(); mTaskType = mDL.DefaultDataID == "user_prize_data.taskweekliveness" ? eTaskType.Week : eTaskType.Normal; m_ChestRoot = mDL.transform.Find("LivenessReward").gameObject; m_CurrLivenessLabel = mDL.transform.Find("LivenessReward/Flag/Liveness").GetComponent <UILabel>(); m_LivenessProgressBar = mDL.transform.Find("LivenessReward/ProgressBar").GetComponent <UIProgressBar>(); m_ReceiveChestRequest = mDL.transform.Find("LivenessReward/ReceiveChestReq").GetComponent <UIServerRequest>(); m_ReceiveChestRequest.onResponse.Add(new EventDelegate(mDL, "OnFetchData")); m_ReceiveWeekChestRequest = mDL.transform.Find("LivenessReward/ReceiveWeekChestReq").GetComponent <UIServerRequest>(); m_ReceiveWeekChestRequest.onResponse.Add(new EventDelegate(mDL, "OnFetchData")); m_ProgressBarLeftPos = mDL.transform.Find("LivenessReward/ProgressBar/LeftPosition"); m_ProgressBarRightPos = mDL.transform.Find("LivenessReward/ProgressBar/RightPosition"); ActivityId = mTaskType == eTaskType.Week?7201:7101; m_Chests = new GameChest[5]; m_Chests[0] = new GameChest(); m_Chests[0].Open = mDL.transform.Find("LivenessReward/0/Open").gameObject; m_Chests[0].UnOpen = mDL.transform.Find("LivenessReward/0/Close").gameObject; m_Chests[0].Light = mDL.transform.Find("LivenessReward/0/Light").gameObject; m_Chests[0].Value = mDL.transform.Find("LivenessReward/0/ActivityNum").GetComponent <UILabel>(); m_Chests[1] = new GameChest(); m_Chests[1].Open = mDL.transform.Find("LivenessReward/1/Open").gameObject; m_Chests[1].UnOpen = mDL.transform.Find("LivenessReward/1/Close").gameObject; m_Chests[1].Light = mDL.transform.Find("LivenessReward/1/Light").gameObject; m_Chests[1].Value = mDL.transform.Find("LivenessReward/1/ActivityNum").GetComponent <UILabel>(); m_Chests[2] = new GameChest(); m_Chests[2].Open = mDL.transform.Find("LivenessReward/2/Open").gameObject; m_Chests[2].UnOpen = mDL.transform.Find("LivenessReward/2/Close").gameObject; m_Chests[2].Light = mDL.transform.Find("LivenessReward/2/Light").gameObject; m_Chests[2].Value = mDL.transform.Find("LivenessReward/2/ActivityNum").GetComponent <UILabel>(); m_Chests[3] = new GameChest(); m_Chests[3].Open = mDL.transform.Find("LivenessReward/3/Open").gameObject; m_Chests[3].UnOpen = mDL.transform.Find("LivenessReward/3/Close").gameObject; m_Chests[3].Light = mDL.transform.Find("LivenessReward/3/Light").gameObject; m_Chests[3].Value = mDL.transform.Find("LivenessReward/3/ActivityNum").GetComponent <UILabel>(); m_Chests[4] = new GameChest(); m_Chests[4].Open = mDL.transform.Find("LivenessReward/4/Open").gameObject; m_Chests[4].UnOpen = mDL.transform.Find("LivenessReward/4/Close").gameObject; m_Chests[4].Light = mDL.transform.Find("LivenessReward/4/Light").gameObject; m_Chests[4].Value = mDL.transform.Find("LivenessReward/4/ActivityNum").GetComponent <UILabel>(); HotfixBtn0 = mDL.transform.Find("LivenessReward/0").GetComponent <UIButton>(); HotfixBtn0.onClick.Add(new EventDelegate(() => { OnChestClick(HotfixBtn0.gameObject); })); HotfixBtn1 = mDL.transform.Find("LivenessReward/1").GetComponent <UIButton>(); HotfixBtn1.onClick.Add(new EventDelegate(() => { OnChestClick(HotfixBtn1.gameObject); })); HotfixBtn2 = mDL.transform.Find("LivenessReward/2").GetComponent <UIButton>(); HotfixBtn2.onClick.Add(new EventDelegate(() => { OnChestClick(HotfixBtn2.gameObject); })); HotfixBtn3 = mDL.transform.Find("LivenessReward/3").GetComponent <UIButton>(); HotfixBtn3.onClick.Add(new EventDelegate(() => { OnChestClick(HotfixBtn3.gameObject); })); HotfixBtn4 = mDL.transform.Find("LivenessReward/4").GetComponent <UIButton>(); HotfixBtn4.onClick.Add(new EventDelegate(() => { OnChestClick(HotfixBtn4.gameObject); })); m_LivenessProgressBar.value = 0f; m_ChestRoot.CustomSetActive(false); for (int chestIndex = 0; chestIndex < m_Chests.Length; ++chestIndex) { m_Chests[chestIndex].OriginPos = m_Chests[chestIndex].UnOpen.transform.localPosition; } }