private void ShowRewardEffect(GoodsType goods, int count, Vector3 startPos) { if (goods == GoodsType.KEY) { ShowRewardKey(goods, count, startPos); return; } if (goods != GoodsType.GOLD && goods != GoodsType.DIAMOND && goods != GoodsType.CAMPSITE_REWARD) { return; } int effectNum = count > m_RewardEffectNum || count < 0 ? m_RewardEffectNum : count; TokenUI tokenUi = Global.gApp.gUiMgr.GetPanelCompent <TokenUI>(Wndid.TokenUI); if (tokenUi != null) { m_IdEffectCountDic[goods] += effectNum; tokenUi.UnLockById(goods, false, false); for (int i = 0; i < effectNum; i++) { RewardEffectUi_RewardItem rewardEffect = RewardItem.GetInstance(); float radius = 0f; if (effectNum > 1) { radius = Random.Range(m_RewardEffectRadius * 0.2f, m_RewardEffectRadius); } float angle = (float)Random.Range(0, 360); float x = radius * Mathf.Cos(angle); float y = radius * Mathf.Sin(angle); Vector3 effectPos = new Vector3(startPos.x + x, startPos.y + y, startPos.z); rewardEffect.Init(goods, effectPos, startPos, this, tokenUi); } } }
public void ResetRoot() { Root.gameObject.SetActive(true); TokenUI tokenUI = Global.gApp.gUiMgr.GetPanelCompent <TokenUI>(Wndid.TokenUI); tokenUI?.SetBgImageActive(false); }
public override void Recycle() { base.Recycle(); TokenUI tokenUI = Global.gApp.gUiMgr.GetPanelCompent <TokenUI>(Wndid.TokenUI); tokenUI?.SetBgImageActive(true); }
public override void Release() { UnRegisterListeners(); base.Release(); TokenUI tokenUI = Global.gApp.gUiMgr.GetPanelCompent <TokenUI>(Wndid.TokenUI); tokenUI?.SetBgImageActive(true); }
public override void Init <T>(string name, UIInfo info, T arg) { base.Init(name, info, arg); ShowTaskInfo(); TokenUI tokenUI = Global.gApp.gUiMgr.GetPanelCompent <TokenUI>(Wndid.TokenUI); tokenUI?.SetBgImageActive(false); }
private void OnCompleteOne() { TokenUI tokenUi = Global.gApp.gUiMgr.GetPanelCompent <TokenUI>(Wndid.TokenUI); bool isEnd = m_Parent.EndOne(goods); if (tokenUi != null) { tokenUi.UnLockById(goods, isEnd, true); } Destroy(gameObject); }
public void Init(GoodsType goods, Vector3 pos, Vector3 startPos, RewardEffectUi parent, TokenUI tokenUI) { this.goods = goods; m_Parent = parent; m_TokenUi = tokenUI; InitIcon(goods); GetComponent <RectTransform>().position = startPos; gameObject.SetActive(true); InitLockPos(goods, pos); }
public override void Recycle() { base.Recycle(); UnregisterListeners(); CommonUI commonUi = Global.gApp.gUiMgr.GetPanelCompent <CommonUI>(Wndid.CommonPanel); commonUi.ResetOrderLayer(); TokenUI tokenUi = Global.gApp.gUiMgr.GetPanelCompent <TokenUI>(Wndid.TokenUI); tokenUi?.SetAddGoldValid(true); Global.gApp.gMainRoleUI.RemoveDragCtrl(); Global.gApp.gMainRoleUI.Hide(); CloseSubPanels(); }
public override void Release() { base.Release(); UnregisterListeners(); CommonUI commonUi = Global.gApp.gUiMgr.GetPanelCompent <CommonUI>(Wndid.CommonPanel); commonUi.ResetOrderLayer(); TokenUI tokenUi = Global.gApp.gUiMgr.GetPanelCompent <TokenUI>(Wndid.TokenUI); tokenUi?.SetAddGoldValid(true); if (gameObject.activeSelf) { Global.gApp.gMainRoleUI.Hide(); } CloseSubPanels(); }
public override void Init <T>(string name, UIInfo info, T arg) { base.Init(name, info, arg); Global.gApp.gMainRoleUI.Show(); var dragRoleModel = RotateNode.gameObject.GetComponent <DragRoleModel>(); Global.gApp.gMainRoleUI.AddDragCtrl(dragRoleModel); RefreshMainWeaponData(); RefreshLevelList(); RefreshIdleReward(); RefreshIdleRate(); RegisterListeners(); InvokeRepeating("RefreshIdleReward", 60f, 60f); CommonUI commonUi = Global.gApp.gUiMgr.GetPanelCompent <CommonUI>(Wndid.CommonPanel); commonUi?.SetOrderLayer(info.Order - 1); TokenUI tokenUi = Global.gApp.gUiMgr.GetPanelCompent <TokenUI>(Wndid.TokenUI); tokenUi?.SetAddGoldValid(false); bool idleRewardOpen = PlayerDataMgr.singleton.ModuleIsOpen(GameModuleType.IdleReward); IdleRewardNode.gameObject.SetActive(idleRewardOpen); QuickIdleNode.gameObject.SetActive(idleRewardOpen); }