//界面打开 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); } }
public override void Update(uint elapsed) { bool changed = false; //基础 if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_BASE)) { changed = true; PropertyBuild.BuildBaseProperty(PlayerDataPool.Instance.MainData, mPlayerBaseProperty); } //装备 if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_EQUIP)) { changed = true; PropertyBuild.BuildEquipProperty(PlayerDataPool.Instance.MainData, mPlayerEquipProperty); //更新外形信息 PropertyBuild.BuildEquipView(PlayerDataPool.Instance.MainData, mEquipConfigs); Player player = PlayerController.Instance.GetControlObj() as Player; if (player != null) { player.ApplyEquipConfig(mEquipConfigs); } } //武器 if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_WEAPON)) { changed = true; PropertyBuild.BuildWeaponProperty(PlayerDataPool.Instance.MainData, mPlayerWeaponProperty); } //翅膀 if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_WING)) { changed = true; PropertyBuild.BuildWingProperty(PlayerDataPool.Instance.MainData, mPlayerWingProperty); } //时装 if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_FASHION)) { changed = true; PropertyBuild.BuildFashionProperty(PlayerDataPool.Instance.MainData, mPlayerFashionProperty); } mMarks.SetAll(false); if (changed) { PropertyEvent evt = new PropertyEvent(PropertyEvent.PLAYER_DATA_PROPERTY_CHANGED); EventSystem.Instance.PushEvent(evt); } }