Merge remote-tracking branch 'origin/master'
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HAA1D_tagMCActTotalRechargeInfo), typeof(DTCAA1D_tagMCActTotalRechargeInfo));
|
| | | Register(typeof(HAA1C_tagMCTotalRechargePlayerInfo), typeof(DTCAA1C_tagMCTotalRechargePlayerInfo));
|
| | | Register(typeof(HA717_tagMCChatBubbleBoxState), typeof(DTCA717_tagMCChatBubbleBoxState));
|
| | | Register(typeof(HB913_tagGCEnterTeamFBFailReason), typeof(DTCB913_tagGCEnterTeamFBFailReason));
|
| | | Register(typeof(H0311_tagDeleteSkill), typeof(DTC0311_tagDeleteSkill));
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, November 06, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | public class DTCAA1C_tagMCTotalRechargePlayerInfo : DtcBasic
|
| | | {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HAA1C_tagMCTotalRechargePlayerInfo;
|
| | | ModelCenter.Instance.GetModel<AccumulateRechargeModel>().UpdateAccumulateRecharge(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5d4ace10ce4b33248bb5e9e3eef9722b |
| | | timeCreated: 1541473219 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, November 06, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using Snxxz.UI;
|
| | | public class DTCAA1D_tagMCActTotalRechargeInfo : DtcBasic {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HAA1D_tagMCActTotalRechargeInfo;
|
| | | OperationTimeHepler.Instance.UpdateAccumulateRecharge(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 62fc9c5ac30b853429d048e9bb3cb4bc |
| | | timeCreated: 1541473252 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AA 1C 累计充值玩家活动信息 #tagMCTotalRechargePlayerInfo
|
| | |
|
| | | public class HAA1C_tagMCTotalRechargePlayerInfo : GameNetPackBasic {
|
| | | public uint GoldTotal; //本次活动已累计充值仙玉数
|
| | | public uint AwardRecord; //奖励领奖记录,按奖励索引二进制位存储是否已领取
|
| | |
|
| | | public HAA1C_tagMCTotalRechargePlayerInfo () {
|
| | | _cmd = (ushort)0xAA1C;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out GoldTotal, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out AwardRecord, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b406f975a6336f843a0b69b63b646a22 |
| | | timeCreated: 1541473174 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AA 1D 累计充值活动信息 #tagMCActTotalRechargeInfo
|
| | |
|
| | | public class HAA1D_tagMCActTotalRechargeInfo : GameNetPackBasic {
|
| | | public string StartDate; // 开始日期 y-m-d
|
| | | public string EndtDate; // 结束日期 y-m-d
|
| | | public byte IsDayReset; //是否每天重置
|
| | | public ushort LimitLV; // 限制等级
|
| | | public byte AwardDays;
|
| | | public tagMCTotalRechargeAwardDay[] AwardDayInfo; //每天对应信息; 如果只有一天,但是活动有多天,则代表每天奖励都一样
|
| | |
|
| | | public HAA1D_tagMCActTotalRechargeInfo () {
|
| | | _cmd = (ushort)0xAA1D;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out StartDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out IsDayReset, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out LimitLV, vBytes, NetDataType.WORD);
|
| | | TransBytes (out AwardDays, vBytes, NetDataType.BYTE);
|
| | | AwardDayInfo = new tagMCTotalRechargeAwardDay[AwardDays];
|
| | | for (int i = 0; i < AwardDays; i ++) {
|
| | | AwardDayInfo[i] = new tagMCTotalRechargeAwardDay();
|
| | | TransBytes (out AwardDayInfo[i].AwardCount, vBytes, NetDataType.BYTE);
|
| | | AwardDayInfo[i].AwardInfo = new tagMCTotalRechargeAward[AwardDayInfo[i].AwardCount];
|
| | | for (int j = 0; j < AwardDayInfo[i].AwardCount; j ++) {
|
| | | AwardDayInfo[i].AwardInfo[j] = new tagMCTotalRechargeAward();
|
| | | TransBytes (out AwardDayInfo[i].AwardInfo[j].AwardIndex, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out AwardDayInfo[i].AwardInfo[j].NeedGold, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out AwardDayInfo[i].AwardInfo[j].AwardItemCount, vBytes, NetDataType.BYTE);
|
| | | AwardDayInfo[i].AwardInfo[j].AwardItem = new tagMCTotalRechargeAwardItem[AwardDayInfo[i].AwardInfo[j].AwardItemCount];
|
| | | for (int k = 0; k < AwardDayInfo[i].AwardInfo[j].AwardItemCount; k ++) {
|
| | | AwardDayInfo[i].AwardInfo[j].AwardItem[k] = new tagMCTotalRechargeAwardItem();
|
| | | TransBytes (out AwardDayInfo[i].AwardInfo[j].AwardItem[k].ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out AwardDayInfo[i].AwardInfo[j].AwardItem[k].ItemCount, vBytes, NetDataType.WORD);
|
| | | TransBytes (out AwardDayInfo[i].AwardInfo[j].AwardItem[k].IsBind, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCTotalRechargeAwardDay {
|
| | | public byte AwardCount; // 奖励档数
|
| | | public tagMCTotalRechargeAward[] AwardInfo; // 奖励档信息
|
| | | }
|
| | |
|
| | | public struct tagMCTotalRechargeAwardItem {
|
| | | public uint ItemID;
|
| | | public ushort ItemCount;
|
| | | public byte IsBind;
|
| | | }
|
| | |
|
| | | public struct tagMCTotalRechargeAward {
|
| | | public byte AwardIndex; // 奖励索引 0~31
|
| | | public uint NeedGold; // 所需仙玉数
|
| | | public byte AwardItemCount; // 奖励物品数
|
| | | public tagMCTotalRechargeAwardItem[] AwardItem; // 奖励物品信息
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6a28a3dad71de0848a8a4414b718c004 |
| | | timeCreated: 1541473173 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | npcContent.text = m_DialogConfig.content;
|
| | |
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(m_DialogConfig.npcId);
|
| | | UI3DModelExhibition.Instance.ShowNPC(m_DialogConfig.npcId, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, npcIcon, false, true);
|
| | | var data = new UI3DModelExhibition.UI3DNPCExhibitionData()
|
| | | {
|
| | | npcId = m_DialogConfig.npcId,
|
| | | isDialogue = true,
|
| | | };
|
| | | UI3DModelExhibition.Instance.ShowNPC(npcIcon, data);
|
| | | }
|
| | |
|
| | | if (m_DialogConfig.TalkID != 0)
|
| | |
| | | [SerializeField] Text m_DogzGrade;
|
| | | [SerializeField] Button m_DogzBtn;
|
| | | [SerializeField] RedpointBehaviour redpointBehav;
|
| | |
|
| | | [SerializeField] GameObject containDivideObj;
|
| | | [SerializeField] List<Image> divideDogzIcons = new List<Image>();
|
| | | DogzModel m_Model;
|
| | | DogzModel model
|
| | | {
|
| | |
| | | redpointBehav.redpointId = model.GetSingleDogzRedpointById(_dogzCfg.ID).id;
|
| | | if (isActive)
|
| | | {
|
| | | containDivideObj.SetActive(false);
|
| | | m_DogzIcon.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | m_DogzName.color = UIHelper.s_NavyBrown;
|
| | | m_DogzGrade.color = UIHelper.s_BrightOrangeColor;
|
| | | }
|
| | | else
|
| | | {
|
| | | containDivideObj.SetActive(true);
|
| | | m_DogzIcon.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_DogzName.color = UIHelper.s_BrightWhiteColor;
|
| | | m_DogzGrade.color = UIHelper.s_BrightWhiteColor;
|
| | | for(int i = 0; i < 5; i++)
|
| | | {
|
| | | var divideImg = divideDogzIcons[i];
|
| | | divideImg.SetSprite(_dogzCfg.HeadIcon);
|
| | | divideImg.SetNativeSize();
|
| | | divideImg.rectTransform.sizeDelta = new Vector2(divideImg.rectTransform.sizeDelta.x / 2, divideImg.rectTransform.sizeDelta.y / 2);
|
| | | ItemModel _equipData = null;
|
| | | bool isEquip = model.TryGetDogzEquip(cell.index,i+101,out _equipData);
|
| | | divideImg.gameObject.SetActive(isEquip);
|
| | | }
|
| | | }
|
| | | m_DogzBtn.image.SetSprite(model.presentSelectDogz == _dogzCfg.ID ? "Title_RightWindow" : "Title_PopupWindow");
|
| | | m_DogzAssist.gameObject.SetActive(model.TryGetAssistDogzState(_dogzCfg.ID));
|
| | |
| | |
|
| | | string npcIcon = configStoryMissions.NpcIcon[IsMultistage];
|
| | |
|
| | | UI3DModelExhibition.Instance.ShowNPC(npcId, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_NPCIcon, false, true);
|
| | | var data = new UI3DModelExhibition.UI3DNPCExhibitionData()
|
| | | {
|
| | | npcId = npcId,
|
| | | isDialogue = true,
|
| | | };
|
| | | UI3DModelExhibition.Instance.ShowNPC(m_NPCIcon,data);
|
| | | }
|
| | | typesPeaker = type;
|
| | | }
|
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class AccumulateRechargeBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] RectTransform m_ContainerOpen;
|
| | | [SerializeField] RectTransform m_ContainerClose;
|
| | | [SerializeField] Text m_MoneyClose;
|
| | | [SerializeField] Text m_MoneyOpen;
|
| | | [SerializeField] Image m_OpenRedpoint;
|
| | | [SerializeField] Image m_CloseRedpoint;
|
| | | [SerializeField] Button m_Select;
|
| | |
|
| | | AccumulateRechargeModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<AccumulateRechargeModel>(); }
|
| | | }
|
| | |
|
| | | int selectIndex = -1;
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Select.onClick.AddListener(Select);
|
| | | }
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | model.selectUpdate += SelectUpdate;
|
| | | model.accumulateRechargeUpdate += AccumulateRechargeUpdate;
|
| | | model.onStateUpate += OnStateUpate;
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | model.selectUpdate -= SelectUpdate;
|
| | | model.accumulateRechargeUpdate -= AccumulateRechargeUpdate;
|
| | | model.onStateUpate -= OnStateUpate;
|
| | | }
|
| | |
|
| | | private void OnStateUpate(int obj)
|
| | | {
|
| | | DisplayRedpoint();
|
| | | }
|
| | |
|
| | | private void AccumulateRechargeUpdate()
|
| | | {
|
| | | DisplayRedpoint();
|
| | | }
|
| | |
|
| | | public void Display(int index)
|
| | | {
|
| | | selectIndex = index;
|
| | | OperationBase operationBase;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | var reward = operation.GetReward(TimeUtility.ServerNow);
|
| | | if (reward != null)
|
| | | {
|
| | | if (index < reward.recharges.Count)
|
| | | {
|
| | | var recharge = reward.recharges[index];
|
| | | m_MoneyClose.text = recharge.requireGold.ToString();
|
| | | m_MoneyOpen.text = recharge.requireGold.ToString();
|
| | | DisplayRedpoint();
|
| | | DisplaySelect();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplaySelect()
|
| | | {
|
| | | m_ContainerOpen.gameObject.SetActive(model.selectIndex == selectIndex);
|
| | | m_ContainerClose.gameObject.SetActive(model.selectIndex != selectIndex);
|
| | | }
|
| | |
|
| | | void DisplayRedpoint()
|
| | | {
|
| | | OperationBase operationBase;
|
| | | bool satisfyGet = false;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | var reward = operation.GetReward(TimeUtility.ServerNow);
|
| | | if (reward != null)
|
| | | {
|
| | | if (selectIndex < reward.recharges.Count && selectIndex >= 0)
|
| | | {
|
| | | var recharge = reward.recharges[selectIndex];
|
| | | satisfyGet = model.SatisfyGetReward(recharge) && model.IsOpen;
|
| | | }
|
| | | }
|
| | | }
|
| | | m_OpenRedpoint.gameObject.SetActive(satisfyGet);
|
| | | m_CloseRedpoint.gameObject.SetActive(satisfyGet);
|
| | | }
|
| | |
|
| | | private void SelectUpdate(int index)
|
| | | {
|
| | | m_ContainerOpen.gameObject.SetActive(index == selectIndex);
|
| | | m_ContainerClose.gameObject.SetActive(index != selectIndex);
|
| | | }
|
| | |
|
| | | private void Select()
|
| | | {
|
| | | if (model.selectIndex != selectIndex && selectIndex != -1)
|
| | | {
|
| | | model.selectIndex = selectIndex;
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 48670b59affb5c0489d46a0f4747deb3 |
| | | timeCreated: 1541489873 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class AccumulateRechargeCell : CellView
|
| | | {
|
| | | [SerializeField] AccumulateRechargeBehaviour m_AccumulateRecharge;
|
| | |
|
| | | public void Display(int index)
|
| | | {
|
| | | m_AccumulateRecharge.Display(index);
|
| | | }
|
| | | }
|
| | |
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c80e2ab2e8ab3e049a27f310655acd14 |
| | | timeCreated: 1541493905 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class AccumulateRechargeModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
|
| | | {
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.AccumulateRecharge);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsAdvance
|
| | | {
|
| | | get
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get { return redpoint.state == RedPointState.Simple; }
|
| | | }
|
| | |
|
| | | int m_SelectIndex = 0;
|
| | | public int selectIndex
|
| | | {
|
| | | get { return m_SelectIndex; }
|
| | | set
|
| | | {
|
| | | if (m_SelectIndex != value)
|
| | | {
|
| | | if (selectUpdate != null)
|
| | | {
|
| | | selectUpdate(value);
|
| | | }
|
| | | }
|
| | | m_SelectIndex = value;
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action accumulateRechargeUpdate;
|
| | | public event Action<int> onStateUpate;
|
| | | public event Action<int> selectUpdate;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | OperationTimeHepler.Instance.dayResetEvent += DayResetEvent;
|
| | | OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.AccumulateRecharge, this);
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | rechargeTotal = 0;
|
| | | getRewardRecord = 0;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
|
| | | OperationTimeHepler.Instance.dayResetEvent -= DayResetEvent;
|
| | | }
|
| | |
|
| | | private void DayResetEvent(int resetType)
|
| | | {
|
| | | OperationBase operationBase;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | if (resetType == operationBase.resetType)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationEndEvent(Operation operationType, int state)
|
| | | {
|
| | | if (operationType == Operation.AccumulateRecharge && state == 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(17);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationStartEvent(Operation operationType, int state)
|
| | | {
|
| | | if (operationType == Operation.AccumulateRecharge && state == 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(17);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | #region 服务端数据
|
| | | public uint rechargeTotal { get; private set; }
|
| | | public uint getRewardRecord { get; private set; }
|
| | | public void UpdateAccumulateRecharge(HAA1C_tagMCTotalRechargePlayerInfo package)
|
| | | {
|
| | | rechargeTotal = package.GoldTotal;
|
| | | getRewardRecord = package.AwardRecord;
|
| | | UpdateRedpoint();
|
| | | if (accumulateRechargeUpdate != null)
|
| | | {
|
| | | accumulateRechargeUpdate();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsRewardGot(OperationAccumulateRecharge.Recharge recharge)
|
| | | {
|
| | | if (recharge != null)
|
| | | {
|
| | | return IsRewardGot(recharge.index);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | bool IsRewardGot(int index)
|
| | | {
|
| | | return (getRewardRecord & (1 << index)) != 0;
|
| | | }
|
| | |
|
| | | public bool SatisfyGetReward(OperationAccumulateRecharge.Recharge recharge)
|
| | | {
|
| | | if (!IsOpen)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (IsRewardGot(recharge))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (rechargeTotal >= recharge.requireGold)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void GetAccumulateRechargeReward(OperationAccumulateRecharge.Recharge recharge)
|
| | | {
|
| | | OperationBase operationBase;
|
| | | if (!OperationTimeHepler.Instance.InOperationTime(Operation.AccumulateRecharge))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|
| | | }
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | if (IsRewardGot(recharge.index))
|
| | | {
|
| | | return;
|
| | | }
|
| | | else if (rechargeTotal < recharge.requireGold)
|
| | | {
|
| | | return;
|
| | | }
|
| | | CA504_tagCMPlayerGetReward pak = new CA504_tagCMPlayerGetReward();
|
| | | pak.RewardType = (byte)GotServerRewardType.Def_RewardType_TotalRecharge;
|
| | | pak.DataEx = (uint)recharge.index;
|
| | | pak.DataExStrLen = 0;
|
| | | pak.DataExStr = string.Empty;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 红点
|
| | | public Redpoint redpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20917);
|
| | |
|
| | | public void UpdateRedpoint()
|
| | | {
|
| | | redpoint.state = RedPointState.None;
|
| | | if (!IsOpen)
|
| | | {
|
| | | return;
|
| | | }
|
| | | OperationBase operationBase;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | var reward = operation.GetReward(TimeUtility.ServerNow);
|
| | | if (reward != null)
|
| | | {
|
| | | for (int i = 0; i < reward.recharges.Count; i++)
|
| | | {
|
| | | var recharge = reward.recharges[i];
|
| | | if (SatisfyGetReward(recharge))
|
| | | {
|
| | | redpoint.state = RedPointState.Simple;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2900b05d6b722c640bd01096d44bb9f7 |
| | | timeCreated: 1541486509 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, November 06, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class AccumulateRechargeWin : Window
|
| | | {
|
| | | [SerializeField] Text m_Money;
|
| | | [SerializeField] ItemCell[] m_Items;
|
| | | [SerializeField] Image[] m_ItemGotSigns;
|
| | | [SerializeField] Text m_Recharge;
|
| | | [SerializeField] Button m_Func;
|
| | | [SerializeField] Text m_FuncBtnTxt;
|
| | | [SerializeField] RectTransform m_ContaienrLess;
|
| | | [SerializeField] AccumulateRechargeBehaviour[] m_AccumulateRecharges;
|
| | | [SerializeField] RectTransform m_ContainerMore;
|
| | | [SerializeField] ScrollerController m_ScrollerControl;
|
| | |
|
| | | [SerializeField] RectTransform m_ContaienrOpen;
|
| | | [SerializeField] RectTransform m_ConatinerOverdue;
|
| | | [SerializeField] Text m_Time;
|
| | |
|
| | | AccumulateRechargeModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<AccumulateRechargeModel>(); }
|
| | | }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Func.onClick.AddListener(OnFunc);
|
| | | m_ScrollerControl.OnRefreshCell += OnRefreshCell;
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | model.selectIndex = 0;
|
| | | model.selectUpdate += SelectUpdate;
|
| | | model.accumulateRechargeUpdate += AccumulateRechargeUpdate;
|
| | | OperationTimeHepler.Instance.dayResetEvent += DayResetEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | |
|
| | | DisplayMoney(model.selectIndex);
|
| | | DisplayItems(model.selectIndex);
|
| | | DisplayFunc(model.selectIndex);
|
| | | DisplayRecharge();
|
| | | DisplayRewards();
|
| | | DisplayTime();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.selectUpdate -= SelectUpdate;
|
| | | model.accumulateRechargeUpdate -= AccumulateRechargeUpdate;
|
| | | OperationTimeHepler.Instance.dayResetEvent -= DayResetEvent;
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnServerOpenDayRefresh;
|
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void OnFunc()
|
| | | {
|
| | | OperationBase operationBase;
|
| | | OperationAccumulateRecharge.Recharge recharge = null;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | var reward = operation.GetReward(TimeUtility.ServerNow);
|
| | | if (model.selectIndex >= 0 && model.selectIndex < reward.recharges.Count)
|
| | | {
|
| | | recharge = reward.recharges[model.selectIndex];
|
| | | }
|
| | | }
|
| | | if (recharge != null)
|
| | | {
|
| | | if (model.SatisfyGetReward(recharge))
|
| | | {
|
| | | model.GetAccumulateRechargeReward(recharge);
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.VipRechargeFunc1);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayMoney(int index)
|
| | | {
|
| | | OperationBase operationBase;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | var reward = operation.GetReward(TimeUtility.ServerNow);
|
| | | if (index >= 0 && index < reward.recharges.Count)
|
| | | {
|
| | | var recharge = reward.recharges[index];
|
| | | m_Money.text = recharge.requireGold.ToString();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayItems(int index)
|
| | | {
|
| | | OperationBase operationBase;
|
| | | OperationAccumulateRecharge.Recharge recharge = null;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | var reward = operation.GetReward(TimeUtility.ServerNow);
|
| | | if (index >= 0 && index < reward.recharges.Count)
|
| | | {
|
| | | recharge = reward.recharges[index];
|
| | | }
|
| | | }
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | m_Items[i].cellBtn.RemoveAllListeners();
|
| | | if (recharge != null && i < recharge.items.Count)
|
| | | {
|
| | | var item = recharge.items[i];
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | ItemCellModel itemCellModel = new ItemCellModel(item.id, true, (ulong)item.count, item.bind);
|
| | | m_Items[i].Init(itemCellModel);
|
| | | m_Items[i].cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(item.id, true, (ulong)item.count, -1, item.bind);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayRecharge()
|
| | | {
|
| | | m_Recharge.text = model.rechargeTotal.ToString();
|
| | | }
|
| | |
|
| | | private void DisplayFunc(int index)
|
| | | {
|
| | | OperationBase operationBase;
|
| | | OperationAccumulateRecharge.Recharge recharge = null;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | var reward = operation.GetReward(TimeUtility.ServerNow);
|
| | | if (index >= 0 && index < reward.recharges.Count)
|
| | | {
|
| | | recharge = reward.recharges[index];
|
| | | }
|
| | | }
|
| | | for (int i = 0; i < m_ItemGotSigns.Length; i++)
|
| | | {
|
| | | m_ItemGotSigns[i].gameObject.SetActive(recharge != null && model.IsRewardGot(recharge));
|
| | | }
|
| | | if (recharge == null)
|
| | | {
|
| | | m_Func.gameObject.SetActive(false);
|
| | | return;
|
| | | }
|
| | | if (model.IsRewardGot(recharge))
|
| | | {
|
| | | m_Func.SetInteractable(m_FuncBtnTxt, false);
|
| | | m_FuncBtnTxt.text = Language.Get("AccumulateRecharge_Got");
|
| | | return;
|
| | | }
|
| | | m_Func.SetInteractable(m_FuncBtnTxt, true);
|
| | | if (model.SatisfyGetReward(recharge))
|
| | | {
|
| | | m_FuncBtnTxt.text = Language.Get("AccumulateRecharge_GetReward");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_FuncBtnTxt.text = Language.Get("AccumulateRecharge_Recharge");
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayRewards()
|
| | | {
|
| | | OperationBase operationBase;
|
| | | OperationAccumulateRecharge.Reward reward = null;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | reward = operation.GetReward(TimeUtility.ServerNow);
|
| | | }
|
| | | m_ContaienrLess.gameObject.SetActive(reward != null && reward.recharges.Count <= 4);
|
| | | m_ContainerMore.gameObject.SetActive(reward != null && reward.recharges.Count > 4);
|
| | | if (reward != null && reward.recharges.Count <= 4)
|
| | | {
|
| | | for (int i = 0; i < m_AccumulateRecharges.Length; i++)
|
| | | {
|
| | | if (i < reward.recharges.Count)
|
| | | {
|
| | | m_AccumulateRecharges[i].gameObject.SetActive(true);
|
| | | m_AccumulateRecharges[i].Display(i);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_AccumulateRecharges[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | else if (reward != null && reward.recharges.Count > 4)
|
| | | {
|
| | | m_ScrollerControl.Refresh();
|
| | | for (int i = 0; i < reward.recharges.Count; i++)
|
| | | {
|
| | | m_ScrollerControl.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | m_ScrollerControl.Restart();
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayTime()
|
| | | {
|
| | | m_ContaienrOpen.gameObject.SetActive(model.IsOpen);
|
| | | m_ConatinerOverdue.gameObject.SetActive(!model.IsOpen);
|
| | | OperationBase operationBase;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | m_Time.text = operation.ToDisplayTime();
|
| | | }
|
| | | }
|
| | |
|
| | | private void SelectUpdate(int index)
|
| | | {
|
| | | DisplayMoney(index);
|
| | | DisplayItems(index);
|
| | | DisplayFunc(index);
|
| | | }
|
| | |
|
| | | private void AccumulateRechargeUpdate()
|
| | | {
|
| | | DisplayRecharge();
|
| | | DisplayFunc(model.selectIndex);
|
| | | }
|
| | |
|
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var accumulateRechargeCell = cell as AccumulateRechargeCell;
|
| | | accumulateRechargeCell.Display(cell.index);
|
| | | }
|
| | |
|
| | | private void DayResetEvent(int resetType)
|
| | | {
|
| | | OperationBase operationBase;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.AccumulateRecharge, out operationBase))
|
| | | {
|
| | | if (resetType == operationBase.resetType)
|
| | | {
|
| | | DisplayRewards();
|
| | | DisplayTime();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationEndEvent(Operation operation, int state)
|
| | | {
|
| | | if (operation == Operation.AccumulateRecharge && state == 0)
|
| | | {
|
| | | DisplayTime();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnServerOpenDayRefresh()
|
| | | {
|
| | | DisplayRewards();
|
| | | DisplayTime();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a1a05819728bfab43b0577e4909355ca |
| | | timeCreated: 1541486287 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | WishingPool,
|
| | | [Header("绑玉转盘")]
|
| | | WheelOfrtune,
|
| | | [Header("累计充值")]
|
| | | AccumulateRecharge,
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | case 16:
|
| | | WindowCenter.Instance.Open<WheelOfFortuneWin>(true);
|
| | | break;
|
| | | case 17:
|
| | | WindowCenter.Instance.Open<AccumulateRechargeWin>(true);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | WindowCenter.Instance.CloseImmediately<FlashRushToBuyWin>();
|
| | | WindowCenter.Instance.CloseImmediately<WishingPoolWin>();
|
| | | WindowCenter.Instance.CloseImmediately<WheelOfFortuneWin>();
|
| | | WindowCenter.Instance.CloseImmediately<AccumulateRechargeWin>();
|
| | | }
|
| | |
|
| | | private int Compare(int order_x, int order_y)
|
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class OperationAccumulateRecharge : OperationBase
|
| | | {
|
| | | public List<Reward> rewards = new List<Reward>();
|
| | | public override bool SatisfyOpenCondition()
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.LV >= limitLv;
|
| | | }
|
| | |
|
| | | public override string ToDisplayTime()
|
| | | {
|
| | | var textBuilder = OperationTimeHepler.textBuilder;
|
| | | textBuilder.Length = 0;
|
| | | textBuilder.Append(startDate.ToDisplay());
|
| | | if (startDate != endDate)
|
| | | {
|
| | | textBuilder.Append("—");
|
| | | textBuilder.Append(endDate.ToDisplay());
|
| | | }
|
| | | return textBuilder.ToString();
|
| | | }
|
| | |
|
| | | public override void Reset()
|
| | | {
|
| | | base.Reset();
|
| | | rewards.Clear();
|
| | | }
|
| | |
|
| | | public void ParseAccumulateRecharge(HAA1D_tagMCActTotalRechargeInfo package)
|
| | | {
|
| | | for (int i = 0; i < package.AwardDays; i++)
|
| | | {
|
| | | var _reward = package.AwardDayInfo[i];
|
| | | Reward reward = new Reward();
|
| | | for (int k = 0; k < _reward.AwardCount; k++)
|
| | | {
|
| | | Recharge recharge = new Recharge();
|
| | | recharge.requireGold = (int)_reward.AwardInfo[k].NeedGold;
|
| | | recharge.index = _reward.AwardInfo[k].AwardIndex;
|
| | | for (int q = 0; q < _reward.AwardInfo[k].AwardItemCount; q++)
|
| | | {
|
| | | var _item = _reward.AwardInfo[k].AwardItem[q];
|
| | | recharge.items.Add(new Item()
|
| | | {
|
| | | id = (int)_item.ItemID,
|
| | | count = _item.ItemCount,
|
| | | bind = _item.IsBind,
|
| | | });
|
| | | }
|
| | | reward.recharges.Add(recharge);
|
| | | }
|
| | | rewards.Add(reward);
|
| | | }
|
| | | }
|
| | |
|
| | | public Reward GetReward(DateTime time)
|
| | | {
|
| | | if (rewards.Count == 0)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | var index = Mathf.Min(rewards.Count - 1, IndexOfTime(time));
|
| | | return rewards[index];
|
| | | }
|
| | |
|
| | | public class Reward
|
| | | {
|
| | | public List<Recharge> recharges = new List<Recharge>();
|
| | | }
|
| | |
|
| | | public class Recharge
|
| | | {
|
| | | public int index;
|
| | | public int requireGold;
|
| | | public List<Item> items = new List<Item>();
|
| | | }
|
| | |
|
| | | public struct Item
|
| | | {
|
| | | public int id;
|
| | | public int bind;
|
| | | public int count;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 628f3c2ad3c339b40b72e76da8ef1fcc |
| | | timeCreated: 1541421540 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 累计充值
|
| | | /// </summary>
|
| | | /// <param name="package"></param>
|
| | | public void UpdateAccumulateRecharge(HAA1D_tagMCActTotalRechargeInfo package)
|
| | | {
|
| | | OperationBase operationBase = null;
|
| | | operationDict.TryGetValue(Operation.AccumulateRecharge, out operationBase);
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(Operation.AccumulateRecharge);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (operationBase == null)
|
| | | {
|
| | | operationBase = new OperationAccumulateRecharge();
|
| | | operationDict.Add(Operation.AccumulateRecharge, operationBase);
|
| | | }
|
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | operation.Reset();
|
| | | operation.limitLv = package.LimitLV;
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.dayReset = package.IsDayReset == 1;
|
| | | operation.ParseAccumulateRecharge(package);
|
| | | if (operationTimeUpdateEvent != null)
|
| | | {
|
| | | operationTimeUpdateEvent(Operation.AccumulateRecharge);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 限时特惠
|
| | | /// </summary>
|
| | | /// <param name="package"></param>
|
| | |
| | | MultipRealmPoint, //N倍修行点
|
| | | FlashRushToBuy, //限时抢购
|
| | | WishingWellInfo, //许愿池
|
| | | AccumulateRecharge,//累计充值
|
| | | max,
|
| | | }
|
| | | }
|
| | |
| | | RegisterModel<RolePointModel>();
|
| | | RegisterModel<SocialModel>();
|
| | | RegisterModel<ChatBubbleModel>();
|
| | | RegisterModel<AccumulateRechargeModel>();
|
| | | inited = true;
|
| | | }
|
| | |
|
| | |
| | | public static UI3DModelExhibition Instance { get; private set; }
|
| | |
|
| | | static UI3DModelExhibition m_InstanceClone1 = null;
|
| | | public static UI3DModelExhibition InstanceClone1
|
| | | {
|
| | | get
|
| | | {
|
| | | public static UI3DModelExhibition InstanceClone1 {
|
| | | get {
|
| | | if (m_InstanceClone1 == null)
|
| | | {
|
| | | CreateCloneStage();
|
| | |
| | | ShowPlayer(_rawImage, data);
|
| | | }
|
| | |
|
| | | public void ShowPlayer(RawImage _rawImage, UI3DPlayerExhibitionData data)
|
| | | void ShowPlayer(RawImage _rawImage, UI3DPlayerExhibitionData data)
|
| | | {
|
| | | StopShow();
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void ShowNPC(RawImage rawImage, UI3DNPCExhibitionData data)
|
| | | {
|
| | | StopShow();
|
| | | ResetCameraColor();
|
| | | var config = Config.Instance.Get<NPCConfig>(data.npcId);
|
| | | var job = 0;
|
| | | if (config.MODE.Contains("A_Zs"))
|
| | | {
|
| | | job = 1;
|
| | | }
|
| | | else if (config.MODE.Contains("A_Fs"))
|
| | | {
|
| | | job = 2;
|
| | | }
|
| | |
|
| | | var offset = config.UIModeLOffset;
|
| | | var eulerAngles = config.UIModelRotation;
|
| | | var scale = Vector3.one * config.UIModeLProportion;
|
| | |
|
| | | var isPlayer = job != 0;
|
| | | if (isPlayer)
|
| | | {
|
| | | var instance = UI3DModelFactory.LoadUINPC(data.npcId);
|
| | | if (instance == null)
|
| | | {
|
| | | DebugEx.LogFormat("无法获得npc模型资源,id :{0}", data.npcId);
|
| | | return;
|
| | | }
|
| | |
|
| | | instance.transform.SetParentEx(data.isDialogue ? m_DialogPoint : m_NPCShowPoint, offset, eulerAngles, scale);
|
| | | npcModel = instance;
|
| | | isShowingNPC = true;
|
| | |
|
| | | var ids = config.Equips.Split('|');
|
| | | var weaponId = int.Parse(ids[0]);
|
| | | var secondaryId = ids.Length > 1 ? int.Parse(ids[1]) : 0;
|
| | | var wingId = ids.Length > 3 ? int.Parse(ids[3]) : 0;
|
| | |
|
| | | playerModel.Show(instance, job, weaponId, wingId, secondaryId, m_PlayerShowPoint);
|
| | | playerModel.UnloadClothedEffect();
|
| | | playerModel.StandUp();
|
| | |
|
| | | m_PlayerShowPoint.localEulerAngles = Vector3.zero;
|
| | | isShowingPlayer = true;
|
| | |
|
| | | interactable = true;
|
| | | m_ShowCamera.enabled = true;
|
| | | if (rawImage != null)
|
| | | {
|
| | | var x = rawImage.rectTransform.rect.height * 4f / 3;
|
| | | var y = rawImage.rectTransform.rect.height;
|
| | | rawImage.rectTransform.sizeDelta = new Vector2(x, y);
|
| | | rawImage.texture = m_ShowCamera.targetTexture;
|
| | | rawImage.material = MaterialUtility.GetGUIRenderTextureMaterial();
|
| | | m_InteractProcessor.rectTransform = rawImage.rectTransform;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ShowNPC(data.npcId, offset, eulerAngles, rawImage, data.gray, data.isDialogue);
|
| | | }
|
| | | }
|
| | |
|
| | | public void ShowNPC(int _npcId, Vector3 _localEulerAngles, RawImage _rawImage, bool _gray = false, bool _isDialogue = false)
|
| | | {
|
| | | ShowNPC(_npcId, Vector3.zero, _localEulerAngles, _rawImage, _gray, _isDialogue);
|
| | |
| | | {
|
| | | m_ShowCamera.enabled = false;
|
| | |
|
| | | if (isShowingNPC)
|
| | | playerModel.Dispose();
|
| | | isShowingPlayer = false;
|
| | |
|
| | | if (npcModel != null)
|
| | | {
|
| | | if (npcModel != null)
|
| | | npcModel.transform.localScale = Vector3.one;
|
| | | if (m_NpcEffect != null)
|
| | | {
|
| | | npcModel.transform.localScale = Vector3.one;
|
| | |
|
| | | if (m_NpcEffect != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_NpcEffect);
|
| | | m_NpcEffect = null;
|
| | | }
|
| | |
|
| | | UI3DModelFactory.ReleaseUINPC(m_NPCId, npcModel);
|
| | | npcModel = null;
|
| | | SFXPlayUtility.Instance.Release(m_NpcEffect);
|
| | | m_NpcEffect = null;
|
| | | }
|
| | |
|
| | | m_NPCId = 0;
|
| | | isShowingNPC = false;
|
| | | UI3DModelFactory.ReleaseUINPC(m_NPCId, npcModel);
|
| | | npcModel = null;
|
| | | }
|
| | | m_NPCId = 0;
|
| | | isShowingNPC = false;
|
| | |
|
| | | if (isShowingHorse)
|
| | | if (horseModel != null)
|
| | | {
|
| | | if (horseModel != null)
|
| | | {
|
| | | horseModel.transform.localScale = Vector3.one;
|
| | | UI3DModelFactory.ReleaseUIHourse(m_HorseModelId, horseModel);
|
| | | horseModel = null;
|
| | | }
|
| | |
|
| | | m_HorseModelId = 0;
|
| | | isShowingHorse = false;
|
| | | horseModel.transform.localScale = Vector3.one;
|
| | | UI3DModelFactory.ReleaseUIHourse(m_HorseModelId, horseModel);
|
| | | horseModel = null;
|
| | | }
|
| | | m_HorseModelId = 0;
|
| | | isShowingHorse = false;
|
| | |
|
| | | if (isShowingPlayer)
|
| | | if (wingModel != null)
|
| | | {
|
| | | playerModel.Dispose();
|
| | | isShowingPlayer = false;
|
| | | wingModel.transform.localScale = Vector3.one;
|
| | | UI3DModelFactory.ReleaseUIWing(m_WingModelId, wingModel);
|
| | | wingModel = null;
|
| | | }
|
| | | m_WingModelId = 0;
|
| | | isShowWing = false;
|
| | |
|
| | | if (isShowWing)
|
| | | if (equipmentModel != null)
|
| | | {
|
| | | if (wingModel != null)
|
| | | {
|
| | | wingModel.transform.localScale = Vector3.one;
|
| | | UI3DModelFactory.ReleaseUIWing(m_WingModelId, wingModel);
|
| | | wingModel = null;
|
| | | }
|
| | | m_WingModelId = 0;
|
| | | isShowWing = false;
|
| | | UI3DModelFactory.ReleaseUIWing(m_EquipmentModelId, equipmentModel);
|
| | | equipmentModel = null;
|
| | | }
|
| | |
|
| | | if (isShowinEquipment)
|
| | | {
|
| | | if (equipmentModel != null)
|
| | | {
|
| | | UI3DModelFactory.ReleaseUIWing(m_EquipmentModelId, equipmentModel);
|
| | | equipmentModel = null;
|
| | | }
|
| | | m_EquipmentModelId = 0;
|
| | | isShowinEquipment = false;
|
| | | }
|
| | | m_EquipmentModelId = 0;
|
| | | isShowinEquipment = false;
|
| | |
|
| | | interactable = false;
|
| | | }
|
| | |
| | | public int secondaryId;
|
| | | public bool isDialogue;
|
| | | }
|
| | |
|
| | | public struct UI3DNPCExhibitionData
|
| | | {
|
| | | public int npcId;
|
| | | public bool gray;
|
| | | public bool isDialogue;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | {
|
| | | showPoint = _showPoint;
|
| | | job = _job;
|
| | | PutOnClothes(_job, _clothes, suitID);
|
| | |
|
| | | var jobConfig = Config.Instance.Get<JobSetupConfig>(_job);
|
| | |
|
| | | var clothesResId = 0;
|
| | | if (_clothes == 0)
|
| | | {
|
| | | clothesResId = jobConfig.BaseEquip[0];
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(_clothes);
|
| | | clothesResId = item == null ? clothesResId = jobConfig.BaseEquip[0] : item.ChangeOrd;
|
| | | }
|
| | | PutOnClothes(_job, clothesResId, suitID);
|
| | |
|
| | | var weaponResId = 0;
|
| | | if (_weaponId == 0)
|
| | | {
|
| | | weaponResId = jobConfig.BaseEquip[1];
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(_weaponId);
|
| | | weaponResId = item == null ? weaponResId = jobConfig.BaseEquip[1] : item.ChangeOrd;
|
| | | }
|
| | | PutOnWeapon(_job, _weaponId);
|
| | | PutOnSecondary(_job, _secondaryId);
|
| | | PutOnWing(_wingsId);
|
| | |
|
| | | var secondaryResId = 0;
|
| | | if (_secondaryId == 0)
|
| | | {
|
| | | if (job == 1)
|
| | | {
|
| | | secondaryResId = clothesId + 2900;
|
| | | }
|
| | | else
|
| | | {
|
| | | secondaryResId = jobConfig.BaseEquip[2];
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(_secondaryId);
|
| | | secondaryResId = item == null ? jobConfig.BaseEquip[2] : item.ChangeOrd;
|
| | | }
|
| | | PutOnSecondary(_job, secondaryResId);
|
| | |
|
| | | var wingsResId = 0;
|
| | | if (_wingsId != 0)
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(_wingsId);
|
| | | wingsResId = item == null ? 0 : item.ChangeOrd;
|
| | | }
|
| | | PutOnWing(wingsResId);
|
| | |
|
| | | return clothesModel;
|
| | | }
|
| | |
|
| | | public GameObject Show(GameObject clothesModel, int job, int weaponResId, int wingsResId, int secondaryResId, Transform showPoint)
|
| | | {
|
| | | this.showPoint = showPoint;
|
| | | this.job = job;
|
| | | this.clothesModel = clothesModel;
|
| | | PutOnWeapon(job, weaponResId);
|
| | | PutOnSecondary(job, secondaryResId);
|
| | | PutOnWing(wingsResId);
|
| | |
|
| | | return clothesModel;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | clothesModel = null;
|
| | | clothesId = 0;
|
| | | weaponId = 0;
|
| | | wingsId = 0;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void PutOnClothes(int _job, int itemID, int suitID)
|
| | | public void PutOnClothes(int _job, int clothesResId, int suitID)
|
| | | {
|
| | | var newClothes = 0;
|
| | | var config = Config.Instance.Get<JobSetupConfig>(_job);
|
| | |
|
| | | if (itemID == 0)
|
| | | {
|
| | | newClothes = config.BaseEquip[0];
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(itemID);
|
| | | newClothes = item == null ? newClothes = config.BaseEquip[0] : item.ChangeOrd;
|
| | | }
|
| | |
|
| | | var oldClothes = clothesId;
|
| | | if (oldClothes == newClothes)
|
| | | if (clothesId == clothesResId)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (oldClothes != 0)
|
| | | if (clothesId != 0)
|
| | | {
|
| | | UnloadClothes();
|
| | | }
|
| | |
|
| | | var _prefab = InstanceResourcesLoader.LoadModelRes(newClothes, true);
|
| | | var _prefab = InstanceResourcesLoader.LoadModelRes(clothesResId, true);
|
| | | if (!_prefab)
|
| | | {
|
| | | newClothes = config.BaseEquip[0];
|
| | | clothesResId = config.BaseEquip[0];
|
| | | }
|
| | |
|
| | | LoadClothes(newClothes);
|
| | | clothesId = newClothes;
|
| | | LoadClothes(clothesResId);
|
| | | clothesId = clothesResId;
|
| | |
|
| | | if (clothesModel)
|
| | | {
|
| | |
| | | wingsModel.transform.SetParentEx(parent, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | }
|
| | |
|
| | | LoadClothesEffect(itemID, suitID);
|
| | | LoadClothesEffect(suitID);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void PutOnWeapon(int _job, int itemID)
|
| | | public void PutOnWeapon(int _job, int resoureceId)
|
| | | {
|
| | | var newWeapon = 0;
|
| | | var config = Config.Instance.Get<JobSetupConfig>(_job);
|
| | |
|
| | | if (itemID == 0)
|
| | | {
|
| | | newWeapon = config.BaseEquip[1];
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(itemID);
|
| | | newWeapon = item == null ? config.BaseEquip[1] : item.ChangeOrd;
|
| | | }
|
| | |
|
| | | var oldWeapon = weaponId;
|
| | | if (oldWeapon == newWeapon)
|
| | | if (oldWeapon == resoureceId)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | weaponModel = null;
|
| | | }
|
| | |
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWeapon, true);
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(resoureceId, true);
|
| | |
|
| | | if (!prefab)
|
| | | {
|
| | | newWeapon = config.BaseEquip[1];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWeapon, true);
|
| | | resoureceId = config.BaseEquip[1];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(resoureceId, true);
|
| | | }
|
| | |
|
| | | if (prefab)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | weaponId = newWeapon;
|
| | | weaponId = resoureceId;
|
| | | }
|
| | |
|
| | | public void PutOnSecondary(int _job, int itemID)
|
| | | public void PutOnSecondary(int _job, int secondaryResId)
|
| | | {
|
| | | var newSecondary = 0;
|
| | | var config = Config.Instance.Get<JobSetupConfig>(_job);
|
| | |
|
| | | if (itemID == 0)
|
| | | {
|
| | | if (job == 1)
|
| | | {
|
| | | // 这里不再读取默认的副手装备,而是根据套装读取默认的手臂装备
|
| | | newSecondary = clothesId + 2900;
|
| | | }
|
| | | else
|
| | | {
|
| | | newSecondary = config.BaseEquip[2];
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(itemID);
|
| | | newSecondary = item == null ? config.BaseEquip[2] : item.ChangeOrd;
|
| | | }
|
| | |
|
| | | var oldSecondary = secondaryId;
|
| | | if (oldSecondary == newSecondary)
|
| | | if (oldSecondary == secondaryResId)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | secondaryModel = null;
|
| | | }
|
| | |
|
| | | if (newSecondary != 0)
|
| | | if (secondaryResId != 0)
|
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newSecondary, true);
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(secondaryResId, true);
|
| | | if (!prefab)
|
| | | {
|
| | | newSecondary = config.BaseEquip[2];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newSecondary, true);
|
| | | var config = Config.Instance.Get<JobSetupConfig>(_job);
|
| | | secondaryResId = config.BaseEquip[2];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(secondaryResId, true);
|
| | | }
|
| | |
|
| | | if (prefab)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | secondaryId = newSecondary;
|
| | | secondaryId = secondaryResId;
|
| | | }
|
| | |
|
| | | public void PutOnWing(int itemID)
|
| | | public void PutOnWing(int resourceId)
|
| | | {
|
| | | var newWings = 0;
|
| | | if (itemID != 0)
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(itemID);
|
| | | newWings = item == null ? 0 : item.ChangeOrd;
|
| | | }
|
| | |
|
| | | var config = Config.Instance.Get<JobSetupConfig>(job);
|
| | |
|
| | | var oldWings = wingsId;
|
| | | if (newWings == oldWings)
|
| | | if (resourceId == oldWings)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | wingsModel = null;
|
| | | }
|
| | |
|
| | | if (newWings != 0)
|
| | | if (resourceId != 0)
|
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWings, true);
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(resourceId, true);
|
| | |
|
| | | if (!prefab)
|
| | | {
|
| | | newWings = config.BaseEquip[3];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWings, true);
|
| | | resourceId = config.BaseEquip[3];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(resourceId, true);
|
| | | }
|
| | |
|
| | | if (prefab)
|
| | |
| | | wingsAnimator = wingsModel.GetComponent<Animator>();
|
| | | if (wingsAnimator == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("翅膀资源{0}没有动画控制器", itemID);
|
| | | DebugEx.LogErrorFormat("翅膀资源{0}没有动画控制器", resourceId);
|
| | | }
|
| | | wingsAnimator.enabled = true;
|
| | | wingsAnimator.Play("UI_Idle", 0);
|
| | | }
|
| | | }
|
| | |
|
| | | wingsId = newWings;
|
| | | wingsId = resourceId;
|
| | | }
|
| | |
|
| | | private PlayerSuitModel SuitModel { get { return ModelCenter.Instance.GetModel<PlayerSuitModel>(); } }
|
| | | private PlayerPackModel PlayerBackModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | public void LoadClothesEffect(int clothedID, int suitLevel)
|
| | | public void LoadClothesEffect(int suitLevel)
|
| | | {
|
| | | UnloadClothedEffect();
|
| | |
|
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.Sprites;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | [RequireComponent(typeof(Image))]
|
| | | public class DivideImage : BaseMeshEffect, ICanvasRaycastFilter
|
| | | {
|
| | | [SerializeField]
|
| | | int m_Divide = 5;
|
| | | public int Divide { get { return m_Divide; } }
|
| | |
|
| | | [SerializeField]
|
| | | int m_CurrentDivide = 1;
|
| | | public int CurrenDivide { get { return m_CurrentDivide; } }
|
| | |
|
| | | [Range(0, 1)] |
| | | [SerializeField] |
| | | float m_FillPercent = 1f; |
| | | public float fillPercent { get { return m_FillPercent; } }
|
| | |
|
| | | [Range(4, 128)] |
| | | [SerializeField] |
| | | int m_Segements = 30; |
| | | public int segements { get { return m_Segements; } }
|
| | |
|
| | | private Image m_Image;
|
| | | public Image image { get { return m_Image ?? (m_Image = this.AddMissingComponent<Image>()); } }
|
| | |
|
| | | private List<Vector3> outterVertices;
|
| | |
|
| | | protected override void Awake()
|
| | | {
|
| | | outterVertices = new List<Vector3>();
|
| | | }
|
| | |
|
| | | public override void ModifyMesh(VertexHelper vh)
|
| | | {
|
| | | vh.Clear();
|
| | | outterVertices.Clear();
|
| | | var degreeDelta = (float)(2 * Mathf.PI / segements);
|
| | | var realSegements = (int)(segements * fillPercent);
|
| | | var width = image.rectTransform.rect.width;
|
| | | var height = image.rectTransform.rect.height;
|
| | | var uv = image.overrideSprite != null ? DataUtility.GetOuterUV(image.overrideSprite) : Vector4.zero;
|
| | | var uvCenterX = (uv.x + uv.z) * 0.5f;
|
| | | var uvCenterY = (uv.y + uv.w) * 0.5f;
|
| | | var uvScaleX = (uv.z - uv.x) / width;
|
| | | var uvScaleY = (uv.w - uv.y) / height;
|
| | | var outerArea = new Vector2(0.5f * width, 0.5f * height);
|
| | | UIVertex uiVertex;
|
| | | var position = Vector2.zero;
|
| | | var uv0 = new Vector2(position.x * uvScaleX + uvCenterX, position.y * uvScaleY + uvCenterY);
|
| | | uiVertex = UIUtility.PackageUIVertex(position, uv0, image.color);
|
| | | vh.AddVert(uiVertex);
|
| | | var everyRad = (float)(2 * Mathf.PI / Divide);
|
| | | var currentRad = everyRad*CurrenDivide - Mathf.PI*0.1f;
|
| | | var verticeCount = 0; |
| | | var triangleCount = 0;
|
| | | verticeCount = realSegements + 1;
|
| | | uv0 = new Vector2(position.x * uvScaleX + uvCenterX, position.y * uvScaleY + uvCenterY);
|
| | | uiVertex = UIUtility.PackageUIVertex(position, uv0, image.color);
|
| | | vh.AddVert(uiVertex);
|
| | |
|
| | | for (int i = 1; i < verticeCount; i++)
|
| | | {
|
| | | var cosA = Mathf.Cos(currentRad);
|
| | | var sinA = Mathf.Sin(currentRad);
|
| | | currentRad = currentRad - degreeDelta;
|
| | | position = new Vector2(cosA * outerArea.x, sinA * outerArea.y);
|
| | | uv0 = new Vector2(position.x * uvScaleX + uvCenterX, position.y * uvScaleY + uvCenterY);
|
| | | uiVertex = UIUtility.PackageUIVertex(position, uv0, image.color);
|
| | | vh.AddVert(uiVertex);
|
| | | outterVertices.Add(position);
|
| | | }
|
| | |
|
| | | triangleCount = realSegements * 3;
|
| | | for (int i = 0, vIdx = 1; i < triangleCount - 3; i += 3, vIdx++)
|
| | | {
|
| | | vh.AddTriangle(vIdx, 0, vIdx + 1);
|
| | | }
|
| | | if (fillPercent == 1)
|
| | | {
|
| | | vh.AddTriangle(verticeCount - 1, 0, 1);
|
| | | }
|
| | | }
|
| | |
|
| | | public virtual bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera)
|
| | | {
|
| | | var sprite = image.overrideSprite;
|
| | | if (sprite == null)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | Vector2 local;
|
| | | RectTransformUtility.ScreenPointToLocalPointInRectangle(image.rectTransform, screenPoint, eventCamera, out local);
|
| | | return Contains(local, outterVertices);
|
| | | }
|
| | |
|
| | | private bool Contains(Vector2 p, List<Vector3> outterVertices)
|
| | | {
|
| | | var crossNumber = 0;
|
| | | crossNumber += UIUtility.RayCrossingCount(p, outterVertices);
|
| | | return (crossNumber & 1) == 1;
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c9a3ad38778aa9e42b4520232ebb3d73 |
| | | timeCreated: 1541142002 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Def_RewardType_FCRecharge = 13,// 仙界盛典充值大礼13W
|
| | | Def_RewardType_FCParty = 14,// 仙界盛典全民来嗨14
|
| | | Def_RewardType_WishingWell = 16,// 许愿池奖励16
|
| | | Def_RewardType_OpenFunc=17,//功能预告奖励
|
| | | Def_RewardType_OpenFunc = 17,//功能预告奖励
|
| | | Def_RewardType_TotalRecharge = 18,//累计充值奖励
|
| | | }
|
| | |
|
| | | public enum MapType
|