| Core/NetworkPackage/ClientPack/ClientToMapServer/CA6_Family/CA605_tagCMFamilyDonate.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/NetworkPackage/ClientPack/ClientToMapServer/CA6_Family/CA605_tagCMFamilyDonate.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/FairyAu/FairyBoss.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/FairyAu/FairyBossModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/NetworkPackage/ClientPack/ClientToMapServer/CA6_Family/CA605_tagCMFamilyDonate.cs
New file @@ -0,0 +1,16 @@ using UnityEngine; using System.Collections; // A6 05 家族捐献兽粮 #tagCMFamilyDonate public class CA605_tagCMFamilyDonate : GameNetPackBasic { public CA605_tagCMFamilyDonate () { combineCmd = (ushort)0x03FE; _cmd = (ushort)0xA605; } public override void WriteToBytes () { } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA6_Family/CA605_tagCMFamilyDonate.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: d4fd9bb9c199d164ea33281a7d748a8d timeCreated: 1535706665 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/FairyAu/FairyBoss.cs
@@ -23,6 +23,8 @@ [SerializeField] RawImage model; [SerializeField] GameObject enterText; [SerializeField] GameObject openText; [SerializeField] ItemCell m_FairyFood; [SerializeField] Button m_HandIn; FairyBossModel m_Model; FairyBossModel fairyBossModel { @@ -30,6 +32,8 @@ return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<FairyBossModel>()); } } PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } } FairyBossTime m_TimeStage; DateTime m_StartTime; @@ -228,6 +232,33 @@ } } private void RefreshItemCountAct(PackType packType, int arg2, int id) { if (packType == PackType.rptItem && id == fairyBossModel.fairyBossFood) { DisplayFairyFood(); } } void DisplayFairyFood() { var singlepack = packModel.GetSinglePackModel(PackType.rptItem); var count = 0; if (singlepack != null) { count = singlepack.GetItemCountByID(fairyBossModel.fairyBossFood); } ItemCellModel itemCellModel = new ItemCellModel(fairyBossModel.fairyBossFood, true, (ulong)count); m_FairyFood.Init(itemCellModel); m_FairyFood.countText.color = UIHelper.GetUIColor(count > 0 ? TextColType.Green : TextColType.Red); m_FairyFood.countText.gameObject.SetActive(true); } private void HandIn() { fairyBossModel.HandInFairyFood(); } protected override void BindController() { @@ -239,6 +270,8 @@ previewBtn.onClick.AddListener(OnPreviewAward); beginBtn.onClick.AddListener(OnBeginBtn); m_GetWayBtn.onClick.AddListener(OnFoodGetWay); m_HandIn.onClick.AddListener(HandIn); m_FairyFood.cellBtn.AddListener(OnFoodGetWay); } protected override void OnPreOpen() @@ -246,9 +279,11 @@ PlayerDatas.Instance.fairyData.OnRefreshFairyBoss += OnRefreshFairyBoss; PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += OnRefreshFairyBoss; TimeMgr.Instance.OnHourEvent += OnRefreshFairyBoss; packModel.RefreshItemCountAct += RefreshItemCountAct; InitData(); OnRefreshFairyBoss(); OnShowFairyBossModel(); DisplayFairyFood(); } @@ -269,6 +304,7 @@ PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= OnRefreshFairyBoss; PlayerDatas.Instance.fairyData.OnRefreshFairyBoss -= OnRefreshFairyBoss; TimeMgr.Instance.OnHourEvent -= OnRefreshFairyBoss; packModel.RefreshItemCountAct -= RefreshItemCountAct; } float m_Time = 0; System/FairyAu/FairyBossModel.cs
@@ -21,6 +21,7 @@ } DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } } public int MapId { get; private set; } public int OpenFairyBossNeed { get; private set; } @@ -148,6 +149,25 @@ fairyBossContinueTime = int.Parse(_stepTime.Split(',')[1]); fairyBossPrepareTime = int.Parse(_stepTime.Split(',')[0]); } public void HandInFairyFood() { var singlepack = packModel.GetSinglePackModel(PackType.rptItem); var count = 0; if (singlepack != null) { count = singlepack.GetItemCountByID(fairyBossFood); } if (count > 0) { CA605_tagCMFamilyDonate pak = new CA605_tagCMFamilyDonate(); GameNetSystem.Instance.SendInfo(pak); } else { SysNotifyMgr.Instance.ShowTip("FairyFoodHandError"); } } } }