public override void Update(uint elapsed) { int day_seconds = ChallengeDefine.Rank_Rest_Time - (int)(TimeUtilities.GetNow() % (24 * 60 * 60 * 1000)); if (day_seconds < 0) { day_seconds = 0; } mRankTimer.text = TimeUtilities.GetCountDownHMS(day_seconds); Player player = PlayerController.Instance.GetControlObj() as Player; PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (player != null && !IsPreviewInit) { mCharacterPreview.SetupCharacter(player.ModelID, null, -1, 0); mCharacterPreview.ChangeWeapon(pdm.GetMainWeaponId()); mCharacterPreview.RotationY = 180; IsPreviewInit = true; } if (IsPreviewInit) { mCharacterPreview.Update(); } }
//界面打开 protected override void OnOpen(object param = null) { if (param == null) { mOtherData = OtherDataPool.Instance.GetOtherData(); } else { mOtherData = (PlayerData)param; } UpdateEquips(); UpdatePlayerData(); OnWingUpdate(); if (!DataManager.PlayerTable.ContainsKey(mOtherData.resId)) { return; } PlayerTableItem item = DataManager.PlayerTable[mOtherData.resId] as PlayerTableItem; if (item != null) { int[] equipConfigs = new int[(int)EquipSlot.EquipSlot_MAX]; PropertyBuild.BuildEquipView(mOtherData, equipConfigs); mPreview.SetupCharacter(item.model, equipConfigs, mOtherData.mWingData.mWearId, uint.MaxValue); mPreview.ChangeWeapon(mOtherData.main_weaponId); } }
//界面打开 protected override void OnOpen(object param = null) { mDataModule = ModuleManager.Instance.FindModule <PlayerDataModule>(); UpdateEquips(); UpdateBags(); UpdatePlayerData(); OnWingUpdate(null); EventSystem.Instance.addEventListener(ItemEvent.UPDATE_CHANGE, ItemUpdateHandler); EventSystem.Instance.addEventListener(PropertyEvent.PLAYER_DATA_PROPERTY_CHANGED, OnDataPropertyChanged); EventSystem.Instance.addEventListener(WingUIEvent.Wing_UI_UPDATE, OnWingUpdate); EventSystem.Instance.addEventListener(ItemEvent.BAG_OP_UNLOCK, OnBagUnlock); Player player = PlayerController.Instance.GetControlObj() as Player; if (player != null) { PlayerPropertyModule module = ModuleManager.Instance.FindModule <PlayerPropertyModule>(); mPreview.SetupCharacter(player.ModelID, module.GetEquipConfigs(), player.GetEquipWing(), uint.MaxValue); mPreview.ChangeWeapon(mDataModule.GetMainWeaponId()); //mPreview.SetupParticle("ui_heiying"); } onOpenBag(); TitleModule tm = ModuleManager.Instance.FindModule <TitleModule>(); mTitleRedPoint.SetActive(tm.IsShowRedPoint); }
private void SetCurSelectCrops(CropsShopGridUI target) { if (null == target) { return; } if (null != mOldSelected) { mOldSelected.SetSelect(false); } mOldSelected = target; mOldSelected.SetSelect(true); mPropertyPanel.SetActive(true); //设置属性信息 SetCurSelecteProperty(target.GetCropsId()); SetCurSelecteStarsLv(target.GetCropsId()); SetCurSelecteSkill(target.GetCropsId()); SetCropsBtn(target.GetCropsId()); NPCTableItem npc = DataManager.NPCTable[target.GetCropsId()] as NPCTableItem; if (null == npc) { return; } mPreview.SetupCharacter(npc.model, null, -1, uint.MaxValue); mPreview.ChangeWeapon(npc.weaponid); }
private void OnReceiveRefreshData(EventBase ev) { arena_simple_s simple_s = mModule.GetFighterData(mIdx); if (simple_s == null) { ClearUI(); return; } this.gameObject.SetActive(true); mInfoText.text = string.Format(StringHelper.GetString("level_name"), simple_s.level, simple_s.name); mBattleGradeText.text = simple_s.grade.ToString(); mAwardText.text = mModule.GetAwardByIdx(mIdx).ToString(); PlayerTableItem res = DataManager.PlayerTable[simple_s.job] as PlayerTableItem; if (res != null) { mPreview.SetupCharacter(res.model, null, -1, uint.MaxValue); mPreview.ChangeWeapon((int)simple_s.weaponid); GameDebug.LogError("武器Id:" + simple_s.weaponid.ToString()); } }
private void OnTryOn() { SoundManager.Instance.Play(15); mWingItemUIList[CurPageNum - 1].IsTryOn = true; Player player = PlayerController.Instance.GetControlObj() as Player; if (player != null) { int wingid = mWingMoudle.GetWingIdByIndex(CurPageNum); mCharacterPreview.SetupCharacter(player.ModelID, null, wingid, mWingMoudle.GetWingLevel(wingid)); PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); mCharacterPreview.ChangeWeapon(pdm.GetMainWeaponId()); } mWingItemUIList[CurPageNum - 1].mView.SetActive(false); mPreviewSprite.gameObject.SetActive(true); upDownAniHandler(); mIsDirty = true; }
protected override void OnOpen(object param = null) { base.OnOpen(param); mModule = ModuleManager.Instance.FindModule <FashionModule>(); IDictionaryEnumerator enumerator = mItemDic.GetEnumerator(); while (enumerator.MoveNext()) { FashionItemUI item = enumerator.Value as FashionItemUI; item.clickCallBack = ItemClickCallBack; } EventDelegate.Add(mAddStarBtn.onClick, OnAddStartClick); EventDelegate.Add(mWearBtn.onClick, OnEquipClick); EventDelegate.Add(mBuyBtn.onClick, OnBuyBtnClick); EventSystem.Instance.addEventListener(FashionEvent.FASHION_ACTIVE, OnRespondActive); EventSystem.Instance.addEventListener(FashionEvent.FASHION_EQUIP, OnRespondEquip); mSelectedId = SelectedId; RefreshListPanel(); if (mCharacterPreview != null) { mCharacterPreview.Enable = true; } Player player = PlayerController.Instance.GetControlObj() as Player; if (player != null) { mCharacterPreview.BackgroundSprite = mPreview; mCharacterPreview.SetTargetSprite(mPreview); mCharacterPreview.SetCameraOrthographicSize(1.2f); mCharacterPreview.RotationY = 180; mCharacterPreview.Pos = new Vector3(-0.25f, 0, 0); mCharacterPreview.SetupCharacter(player.ModelID, null, -1, 0); PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); mCharacterPreview.ChangeWeapon(pdm.GetMainWeaponId()); } }