Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | Register(typeof(HA814_tagMCMakeItemAnswer), typeof(DTCA814_tagMCMakeItemAnswer)); //得到合成结果回应
|
| | | Register(typeof(HA317_tagMCAllEquipAttrActiveInfo), typeof(DTCA317_tagMCAllEquipAttrActiveInfo)); //得到激活全身星级和全身强化的信息
|
| | | Register(typeof(HA321_tagMCPrayElixirResult), typeof(DTCA321_tagMCPrayElixirResult)); //祈福丹药结果
|
| | |
|
| | | Register(typeof(HA921_tagUpdatePlayerNameResult), typeof(DTCA921_tagUpdatePlayerNameResult)); //玩家改名
|
| | | #region 背包
|
| | | Register(typeof(H0724_tagRolePackCanUseCount), typeof(DTC0724_tagRolePackCanUseCount));
|
| | | Register(typeof(H0704_tagRolePackRefresh), typeof(DTC0704_tagRolePackRefresh));
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Saturday, January 06, 2018 |
| | | // [ Date ]: Thursday, September 27, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | |
| | | public partial class VipPrivilegeConfig : ConfigBase { |
| | | |
| | | public int VIPPrivilege { get ; private set ; } |
| | | public int VIP0 { get ; private set ; } |
| | | public int VIP1 { get ; private set ; } |
| | | public int VIP2 { get ; private set ; } |
| | | public int VIP3 { get ; private set ; } |
| | | public int VIP4 { get ; private set ; } |
| | | public int VIP5 { get ; private set ; } |
| | | public int VIP6 { get ; private set ; } |
| | | public int VIP7 { get ; private set ; } |
| | | public int VIP8 { get ; private set ; } |
| | | public int VIP9 { get ; private set ; } |
| | | public int VIP10 { get ; private set ; } |
| | | public int VIP11 { get ; private set ; } |
| | | public int VIP12 { get ; private set ; } |
| | | public int VIP13 { get ; private set ; } |
| | | public int VIP14 { get ; private set ; } |
| | | public int VIPPrivilege { get ; private set ; }
|
| | | public int VIP0 { get ; private set ; }
|
| | | public int VIP1 { get ; private set ; }
|
| | | public int VIP2 { get ; private set ; }
|
| | | public int VIP3 { get ; private set ; }
|
| | | public int VIP4 { get ; private set ; }
|
| | | public int VIP5 { get ; private set ; }
|
| | | public int VIP6 { get ; private set ; }
|
| | | public int VIP7 { get ; private set ; }
|
| | | public int VIP8 { get ; private set ; }
|
| | | public int VIP9 { get ; private set ; }
|
| | | public int VIP10 { get ; private set ; }
|
| | | public int VIP11 { get ; private set ; }
|
| | | public int VIP12 { get ; private set ; }
|
| | | public int VIP13 { get ; private set ; }
|
| | | public int VIP14 { get ; private set ; }
|
| | | public int VIP15 { get ; private set ; } |
| | | |
| | | public override string getKey() |
| | |
| | | public override void Parse() { |
| | | try |
| | | { |
| | | VIPPrivilege=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | VIP0=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | VIP1=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | VIP2=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | |
| | | VIP3=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | |
| | | VIP4=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; |
| | | |
| | | VIP5=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; |
| | | |
| | | VIP6=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; |
| | | |
| | | VIP7=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0; |
| | | |
| | | VIP8=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0; |
| | | |
| | | VIP9=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0; |
| | | |
| | | VIP10=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0; |
| | | |
| | | VIP11=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0; |
| | | |
| | | VIP12=IsNumeric(rawContents[13]) ? int.Parse(rawContents[13]):0; |
| | | |
| | | VIP13=IsNumeric(rawContents[14]) ? int.Parse(rawContents[14]):0; |
| | | |
| | | VIP14=IsNumeric(rawContents[15]) ? int.Parse(rawContents[15]):0; |
| | | |
| | | VIPPrivilege=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | VIP0=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | VIP1=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | VIP2=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | |
| | | VIP3=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | |
| | | VIP4=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; |
| | | |
| | | VIP5=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; |
| | | |
| | | VIP6=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; |
| | | |
| | | VIP7=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0; |
| | | |
| | | VIP8=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0; |
| | | |
| | | VIP9=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0; |
| | | |
| | | VIP10=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0; |
| | | |
| | | VIP11=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0; |
| | | |
| | | VIP12=IsNumeric(rawContents[13]) ? int.Parse(rawContents[13]):0; |
| | | |
| | | VIP13=IsNumeric(rawContents[14]) ? int.Parse(rawContents[14]):0; |
| | | |
| | | VIP14=IsNumeric(rawContents[15]) ? int.Parse(rawContents[15]):0; |
| | | |
| | | VIP15=IsNumeric(rawContents[16]) ? int.Parse(rawContents[16]):0; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | fileFormatVersion: 2 |
| | | guid: fe03774548a971a4186f518d32a9833c |
| | | timeCreated: 1515213454 |
| | | licenseType: Pro |
| | | timeCreated: 1538035356 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 07973e7d7a8d7dc499729078a1b20c19 |
| | | folderAsset: yes |
| | | timeCreated: 1538027291 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A1 22 角色改名 #tagUpdatePlayerName
|
| | |
|
| | | public class CA122_tagUpdatePlayerName : GameNetPackBasic {
|
| | | public byte NewNameLen;
|
| | | public string NewName;
|
| | | public byte ItemIndex; //改名物品在背包中的位置
|
| | | public uint ServerID;
|
| | |
|
| | | public CA122_tagUpdatePlayerName () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA122;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (NewNameLen, NetDataType.BYTE);
|
| | | WriteBytes (NewName, NetDataType.Chars, NewNameLen);
|
| | | WriteBytes (ItemIndex, NetDataType.BYTE);
|
| | | WriteBytes (ServerID, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f1760446cb920c8429e4e5a021a6452b |
| | | timeCreated: 1538027291 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A5 17 绑玉转盘开始 #tagCMStartBindJadeWheel
|
| | |
|
| | | public class CA517_tagCMStartBindJadeWheel : GameNetPackBasic {
|
| | |
|
| | | public CA517_tagCMStartBindJadeWheel () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA517;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7c268dd5f343f6c49b4c2621de591e6f |
| | | timeCreated: 1538032691 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | |
|
| | | // A3 24 通知绑玉转盘结果 #tagMCBindJadeWheelResult
|
| | |
|
| | |
|
| | |
|
| | | public class DTCA324_tagMCBindJadeWheelResult : DtcBasic {
|
| | |
|
| | | WheelOfFortuneModel wheelOfFortuneModel { get { return ModelCenter.Instance.GetModel<WheelOfFortuneModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA324_tagMCBindJadeWheelResult vNetData = vNetPack as HA324_tagMCBindJadeWheelResult;
if (vNetData == null)
|
| | | {
|
| | | return;
|
| | | }
wheelOfFortuneModel.BindJadeWheelResult(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a0cbd69e7afc2474c8fd98b86348e72f |
| | | timeCreated: 1538032691 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | | //A9 21 角色改名结果 #tagUpdatePlayerNameResult
|
| | |
|
| | |
|
| | |
|
| | | public class DTCA921_tagUpdatePlayerNameResult : DtcBasic {
|
| | |
|
| | | RoleModel roleModel { get { return ModelCenter.Instance.GetModel<RoleModel>(); } }
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | |
|
| | | base.Done(vNetPack);
|
| | |
|
| | | HA921_tagUpdatePlayerNameResult vNetData = vNetPack as HA921_tagUpdatePlayerNameResult;
|
| | | roleModel.ServerRenameResult(vNetData);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 104734d3ab0b9eb4282d52f46be5f76c |
| | | timeCreated: 1538027291 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 24 通知绑玉转盘结果 #tagMCBindJadeWheelResult
|
| | |
|
| | | public class HA324_tagMCBindJadeWheelResult : GameNetPackBasic {
|
| | | public byte Index; // 格子
|
| | | public byte Cnt; //今日已转次数
|
| | |
|
| | | public HA324_tagMCBindJadeWheelResult () {
|
| | | _cmd = (ushort)0xA324;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Index, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Cnt, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d6ba1d40695294e48abc2835e49bc818 |
| | | timeCreated: 1538032691 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A9 21 角色改名结果 #tagUpdatePlayerNameResult
|
| | |
|
| | | public class HA921_tagUpdatePlayerNameResult : GameNetPackBasic {
|
| | | public byte Result; //角色改名结果
|
| | |
|
| | | public HA921_tagUpdatePlayerNameResult () {
|
| | | _cmd = (ushort)0xA921;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Result, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 658f4d57fa7989c47ab85b6bdaf40211 |
| | | timeCreated: 1538027291 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | }
|
| | | m_Controller.Restart();
|
| | | }
|
| | | int jumpIndex = model.presentSelectDogz - 1 > 0 ? model.presentSelectDogz - 1 : 0;
|
| | | int jumpIndex = model.presentSelectDogz - 2 > 0 ? model.presentSelectDogz - 2 : 0;
|
| | | m_Controller.JumpIndex(jumpIndex);
|
| | | }
|
| | |
|
| | |
| | | private void UpdateDogzAssistCnt()
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | m_DogzAssistCnt.text = Language.Get("TreasurePrivilege_Dogz_1", StringUtility.Contact(model.GetAssistDogzCount(), "/", model.DogzAssistDefaultCnt));
|
| | | m_DogzAssistCnt.text = Language.Get("TreasurePrivilege_Dogz_1", StringUtility.Contact(model.GetAssistDogzCount(), "/", model.curSumAssistNum));
|
| | | UpdateDogzBtn();
|
| | | UpdateDogzProperty();
|
| | | UpdateDogzEquip();
|
| | |
| | |
|
| | | private void AddAssist()
|
| | | {
|
| | | if(model.IsAddMaxAssist())
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("DogzNumLimit");
|
| | | return;
|
| | | }
|
| | |
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>(model.AddAssistItem);
|
| | | ConfirmCancel.ShowItemConfirm(Language.Get("DogzFunc102", _itemConfig.ItemName, model.GetAssistItemCnt()),
|
| | | model.AddAssistItem, model.GetAssistItemCnt(), () =>
|
| | | model.AddAssistItem, model.GetAssistItemCnt(), () =>
|
| | | {
|
| | | model.SendBuyAssistCnt();
|
| | | if (model.curSumAssistNum + 1 >= model.DogzAssistMaxCnt)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("DogzNumLimit");
|
| | | }
|
| | | });
|
| | | }
|
| | | private void TakeOffEquip()
|
| | |
| | | {
|
| | | if(!model.TryGetAssistDogzState(model.presentSelectDogz))
|
| | | {
|
| | | if(model.GetAssistDogzCount() < model.DogzAssistDefaultCnt)
|
| | | if(model.GetAssistDogzCount() < model.curSumAssistNum)
|
| | | {
|
| | | assistEffect.Play();
|
| | | assistTextEffect.Play();
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | curSumAssistNum = DogzAssistDefaultCnt;
|
| | | addAssistCnt = 0;
|
| | | SelectDogzItemQuality = 0;
|
| | | SelectDogzItemStart = 0;
|
| | |
| | |
|
| | | #region 配置
|
| | | private Dictionary<int, Dictionary<int, int>> m_DogzEquipLimit = new Dictionary<int, Dictionary<int, int>>(); //装备位 品质限制
|
| | | public int DogzAssistDefaultCnt { get; private set; } //助战神兽总数
|
| | | public int DogzAssistDefaultCnt { get; private set; } //助战神兽默认数量
|
| | | public int DogzAssistMaxCnt { get; private set; }//助战神兽最大数
|
| | | public int AddAssistItem { get; private set; } //增加助战神兽总数的物品Id
|
| | | public int DogzPackGridCnt { get; private set; } //神兽物品背包格子数
|
| | |
| | |
|
| | | public int GetAssistItemCnt()
|
| | | {
|
| | | return AddAssistItemCnt[addAssistCnt];
|
| | | if(!IsAddMaxAssist())
|
| | | {
|
| | | return AddAssistItemCnt[addAssistCnt];
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | return AddAssistItemCnt[AddAssistItemCnt.Length - 1];
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsAddMaxAssist()
|
| | | {
|
| | | if (curSumAssistNum < DogzAssistMaxCnt)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | public int presentSelectDogz { get; set; } //当前选中的神兽id
|
| | |
| | | #region 协议
|
| | |
|
| | | public int addAssistCnt { get; private set; } //额外购买的助战数
|
| | | public int curSumAssistNum { get; private set; } //当前可以助战的神兽数量
|
| | | public void SetServerAddAssistDogzCnt(HA3C0_tagMCDogzInfo info)
|
| | | {
|
| | | addAssistCnt = info.BuyHelpbattleCount;
|
| | | DogzAssistDefaultCnt += addAssistCnt;
|
| | | curSumAssistNum = DogzAssistDefaultCnt + addAssistCnt;
|
| | | if (UpdateAssistDogzEvent != null)
|
| | | {
|
| | | UpdateAssistDogzEvent();
|
| | |
| | | {
|
| | | var configs = Config.Instance.GetAllValues<DogzConfig>();
|
| | | presentSelectDogz = configs[0].ID;
|
| | | foreach (var key in m_DogzEquipLimit.Keys)
|
| | | if(dogzFuncRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | Redpoint redpoint = GetSingleDogzRedpointById(key);
|
| | | if (redpoint.state == RedPointState.Simple)
|
| | | foreach (var key in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | presentSelectDogz = key;
|
| | | break;
|
| | | Redpoint redpoint = GetSingleDogzRedpointById(key);
|
| | | if (redpoint.state == RedPointState.Simple)
|
| | | {
|
| | | presentSelectDogz = key;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | foreach(var key in dogzAssistStateDict.Keys)
|
| | | {
|
| | | if(TryGetAssistDogzState(key))
|
| | | {
|
| | | presentSelectDogz = presentSelectDogz > key ? presentSelectDogz : key;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | value.state = RedPointState.None;
|
| | | }
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= DogzAssistDefaultCnt ? true : false;
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= curSumAssistNum ? true : false;
|
| | | int minAlreadyAssistId = 0;
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | if (TryGetAssistDogzState(dogzId)
|
| | | && ((minAlreadyAssistId > dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | {
|
| | | minAlreadyAssistId = dogzId;
|
| | | }
|
| | | }
|
| | |
|
| | | if (!isMaxAssistNum)
|
| | | {
|
| | | int minAlreadyAssistId = 0;
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | if (TryGetAssistDogzState(dogzId)
|
| | | && ((minAlreadyAssistId < dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | {
|
| | | minAlreadyAssistId = dogzId;
|
| | | }
|
| | | }
|
| | |
|
| | | int maxDogzId = 0;
|
| | | foreach(var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | |
| | | {
|
| | | var equips = GetDogzEquips(dogzId);
|
| | | int equipNum = equips == null ? 0 : equips.Count;
|
| | | if(!TryGetAssistDogzState(dogzId) && equipNum == 5)
|
| | | if(!TryGetAssistDogzState(dogzId) && equipNum == 5
|
| | | && ((minAlreadyAssistId != 0 && dogzId > minAlreadyAssistId) || minAlreadyAssistId == 0))
|
| | | {
|
| | | Redpoint assistRedpoint = GetDogzAssistRedpointById(dogzId);
|
| | | if (assistRedpoint.state == RedPointState.None)
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= DogzAssistDefaultCnt ? true : false;
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= curSumAssistNum ? true : false;
|
| | | if (!isMaxAssistNum)
|
| | | {
|
| | | int maxEquipNum = 0;
|
| | |
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | if(TryGetAssistDogzState(dogzId)
|
| | | && ((minAlreadyAssistId < dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | && ((minAlreadyAssistId > dogzId && minAlreadyAssistId != 0) || minAlreadyAssistId == 0))
|
| | | {
|
| | | minAlreadyAssistId = dogzId;
|
| | | }
|
| | |
| | |
|
| | | public void UpdateAssistNumRed()
|
| | | {
|
| | | if(CheckIsAddAssistNum())
|
| | | if(CheckIsAddAssistNum() && !IsAddMaxAssist())
|
| | | {
|
| | | if(addAssistDogzRedpoint.state == RedPointState.None)
|
| | | {
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, September 27, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class DungeonAncientKingWin : Window
|
| | | {
|
| | | [SerializeField] Text m_AncientKingName;
|
| | | [SerializeField] Text m_AncientKingPoint;
|
| | | [SerializeField] ItemCell[] m_Items;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | DungeonModel m_Model;
|
| | | DungeonModel model
|
| | | {
|
| | | get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>()); }
|
| | | }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Close.onClick.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | model.updateMissionEvent -= UpdateTargets;
|
| | | UpdateTargets();
|
| | | DisplayAward();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.updateMissionEvent -= UpdateTargets;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | | private void UpdateTargets()
|
| | | {
|
| | | var _help = model.mission;
|
| | | m_AncientKingName.text = _help.topName;
|
| | | m_AncientKingPoint.text = UIHelper.ReplaceLargeNum(_help.topScore);
|
| | | }
|
| | |
|
| | | private void DisplayAward()
|
| | | {
|
| | | var awards = GeneralConfig.Instance.ancientKingAwards;
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | m_Items[i].cellBtn.RemoveAllListeners();
|
| | | if (i < awards.Count)
|
| | | {
|
| | | var award = awards[i];
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | ItemCellModel itemCellModel = new ItemCellModel(award.id, true, (ulong)award.count, award.bind ? 1 : 0);
|
| | | m_Items[i].Init(itemCellModel);
|
| | | m_Items[i].cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(award.id, true, (ulong)award.count, -1, award.bind ? 1 : 0);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 174d70b8ee292354fb10efc54511ffb9 |
| | | timeCreated: 1538034810 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class DungeonAncientTargetWin : Window |
| | | { |
| | | [SerializeField] List<Text> m_DungeonTargets; |
| | | [SerializeField] DungeonTargetBehaviour m_DungeonTargetBehaviour; |
| | | |
| | | DungeonModel m_Model; |
| | | DungeonModel model |
| | | { |
| | | get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>()); } |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | } |
| | | |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | model.updateMissionEvent -= UpdateTargets; |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | model.updateMissionEvent += UpdateTargets; |
| | | m_DungeonTargetBehaviour.Init(31160); |
| | | UpdateTargets(); |
| | | } |
| | | |
| | | private void UpdateTargets() |
| | | { |
| | | var _help = model.mission; |
| | | m_DungeonTargets[0].text = _help.topName; |
| | | m_DungeonTargets[1].text = UIHelper.ReplaceLargeNum(_help.topScore); |
| | | } |
| | | } |
| | | } |
| | | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class DungeonAncientTargetWin : Window
|
| | | {
|
| | | //[SerializeField] List<Text> m_DungeonTargets;
|
| | | [SerializeField] DungeonTargetBehaviour m_DungeonTargetBehaviour;
|
| | |
|
| | | DungeonModel m_Model;
|
| | | DungeonModel model
|
| | | {
|
| | | get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>()); }
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | //model.updateMissionEvent -= UpdateTargets;
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | //model.updateMissionEvent += UpdateTargets;
|
| | | m_DungeonTargetBehaviour.Init(31160);
|
| | | //UpdateTargets();
|
| | | }
|
| | |
|
| | | private void UpdateTargets()
|
| | | {
|
| | | //var _help = model.mission;
|
| | | //m_DungeonTargets[0].text = _help.topName;
|
| | | //m_DungeonTargets[1].text = UIHelper.ReplaceLargeNum(_help.topScore);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] RectTransform m_ContainerResPoint;
|
| | | [SerializeField] RectTransform m_ContainerAncient;
|
| | | [SerializeField] Button m_AncientBtn;
|
| | | [SerializeField] Button m_AncientKing;
|
| | | [SerializeField] DungeonItemCollect m_ItemCollect;
|
| | | [SerializeField] DungeonGuardSkyBehaviour m_GuardSky;
|
| | | [SerializeField] DungeonBossBriefInfoContainer m_BossInfosContainer;
|
| | |
| | | {
|
| | | m_ExitDungeon.AddListener(ExitDungeon);
|
| | | m_AncientBtn.onClick.AddListener(OnAncientBtn);
|
| | | m_AncientKing.onClick.AddListener(AncientKing);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void AncientKing()
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<DungeonAncientKingWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<DungeonAncientKingWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<DungeonAncientKingWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateDungeonExitTime()
|
| | | {
|
| | | if (existSurplusTime > 0f)
|
| | |
| | | using System;
|
| | | using System.Text.RegularExpressions;
|
| | | using System.Linq;
|
| | | using Snxxz.UI;
|
| | |
|
| | | public class GeneralConfig : Singleton<GeneralConfig>
|
| | | {
|
| | |
| | |
|
| | | public string teamWorldCall;
|
| | | public int teamWorldCallInviteCount;
|
| | |
|
| | | public List<Item> ancientKingAwards = new List<Item>();
|
| | |
|
| | | public void Init()
|
| | | {
|
| | |
| | |
|
| | | teamWorldCall = GetInputString("TeamWorldCall");
|
| | | teamWorldCallInviteCount = GetInt("TeamWorldCall", 2);
|
| | |
|
| | | var ancientKingAwradConfig = Config.Instance.Get<FuncConfigConfig>("ElderBattlefieldTopAward");
|
| | | if (ancientKingAwradConfig != null)
|
| | | {
|
| | | var itemArray = LitJson.JsonMapper.ToObject<int[][]>(ancientKingAwradConfig.Numerical1);
|
| | | for (int k = 0; k < itemArray.Length; k++)
|
| | | {
|
| | | ancientKingAwards.Add(new Item()
|
| | | {
|
| | | id = itemArray[k][0],
|
| | | count = itemArray[k][1],
|
| | | bind = itemArray[k][2] == 1,
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, September 26, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class UpgradeWin : Window |
| | | { |
| | | [SerializeField] UIAlphaTween m_UIAlphaTween;
|
| | | [SerializeField] ScaleTween m_ScaleTween;
|
| | | [SerializeField] UIAlphaTween m_UIAlphaTween1; |
| | | [SerializeField] GameObject m_Guang; |
| | | [SerializeField] Text m_TextLV; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | // m_Guang.SetActive(false); |
| | | m_TextLV.text = PlayerDatas.Instance.baseData.LV.ToString(); |
| | | m_UIAlphaTween1.SetEndState(); |
| | |
|
| | |
|
| | | } |
| | | protected override void OnActived()
|
| | | {
|
| | | m_UIAlphaTween.Play(ShowOverAlpha);
|
| | | m_ScaleTween.Play();
|
| | | } |
| | | protected override void OnAfterOpen() |
| | | {
|
| | | |
| | | WindowCenter.Instance.windowBeforeCloseEvent += windowBeforeClose;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;//数据的刷新(h0418) |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | {
|
| | | WindowCenter.Instance.windowBeforeCloseEvent -= windowBeforeClose;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;//数据的刷新(h0418) |
| | | }
|
| | |
|
| | | private void windowBeforeClose(Window _window)
|
| | | {
|
| | | if (_window is MainInterfaceWin)
|
| | | {
|
| | | Close();
|
| | | }
|
| | | }
|
| | |
|
| | | private void Updatefighting(PlayerDataRefresh obj)
|
| | | {
|
| | | if (obj == PlayerDataRefresh.LV)
|
| | | {
|
| | | m_TextLV.text = PlayerDatas.Instance.baseData.LV.ToString();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose() |
| | | { |
| | | }
|
| | | #endregion |
| | | private void ShowOverAlpha()
|
| | | {
|
| | | m_UIAlphaTween.Play(true);
|
| | | m_UIAlphaTween1.Play(true);
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4bcd6e645b0e4dc4fb3359ce209aa612 |
| | | timeCreated: 1537944869 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public override void UnInit()
|
| | | {
|
| | | }
|
| | | |
| | |
|
| | | #region 协议
|
| | | public void ServerRenameResult(HA921_tagUpdatePlayerNameResult renameResult)
|
| | | {
|
| | | switch ((RoleRenameResult)renameResult.Result)
|
| | | {
|
| | | case RoleRenameResult.MoneyErr:
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | break;
|
| | | case RoleRenameResult.NameRuleErr:
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("L1007"));
|
| | | break;
|
| | | case RoleRenameResult.NameLengErr:
|
| | | break;
|
| | | case RoleRenameResult.NameRepeatErr:
|
| | | SysNotifyMgr.Instance.ShowTip("RepeatName");
|
| | | break;
|
| | | case RoleRenameResult.RenameFailErr:
|
| | | break;
|
| | | case RoleRenameResult.RenameSuccess:
|
| | | SysNotifyMgr.Instance.ShowTip("RepeatName");
|
| | | break;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
|
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using System.Text.RegularExpressions;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class RoleRenameWin : Window
|
| | | {
|
| | | [SerializeField] InputField renameInput;
|
| | | [SerializeField] Button sureBtn;
|
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] ItemCell itemCell;
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | | }
|
| | | protected override void AddListeners()
|
| | | {
|
| | | sureBtn.AddListener(ClickRenameBtn);
|
| | | closeBtn.AddListener(CloseClick);
|
| | | }
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | |
|
| | | }
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | | }
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | |
| | | }
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | private void OnDisplay()
|
| | | {
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(953);
|
| | | if (itemConfig == null) return;
|
| | | ItemCellModel cellModel = new ItemCellModel(953,false,(ulong)GetRenameToolNum());
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(953);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | |
|
| | | private int GetRenameToolNum()
|
| | | {
|
| | | return playerPack.GetItemCountByID(PackType.rptItem,953);
|
| | | }
|
| | |
|
| | | private int GetRenameToolIndex()
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return -1;
|
| | |
|
| | | List<int> indexlist = singlePack.ItemIndexlist(953,1);
|
| | | if(indexlist.Count > 0)
|
| | | {
|
| | | return indexlist[0];
|
| | | }
|
| | | return -1;
|
| | | }
|
| | |
|
| | | private void ClickRenameBtn()
|
| | | {
|
| | | if (renameInput.text.Equals(string.Empty))
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("CreateRole_NameNull"));
|
| | | return;
|
| | | }
|
| | | if(GetRenameToolNum() < 1)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip("角色改名卡不足");
|
| | | return;
|
| | | }
|
| | |
|
| | | if (Encoding.UTF8.GetBytes(renameInput.text).Length < 6)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("CreateRole_NameShort"));
|
| | | return;
|
| | | }
|
| | | if (!CheckNameLengthLimit(renameInput.text))
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("CreateRole_NameLimit"));
|
| | | return;
|
| | | }
|
| | | if (DirtyWordConfig.IsDirtWord(renameInput.text) || UIHelper.HasSpecialCharac(renameInput.text)
|
| | | || DirtyNameConfig.IsDirtName(renameInput.text))
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("L1007"));
|
| | | return;
|
| | | }
|
| | |
|
| | | LanguageVerify.Instance.VerifyPlayerName(renameInput.text, 0,
|
| | | UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName),PlayerDatas.Instance.baseData.LV, |
| | | PlayerDatas.Instance.baseData.VIPLv, (bool ok, string name) =>
|
| | | {
|
| | | if(ok)
|
| | | {
|
| | | CA122_tagUpdatePlayerName renamePlayerName = new CA122_tagUpdatePlayerName();
|
| | | renamePlayerName.NewNameLen = (byte)name.Length;
|
| | | renamePlayerName.NewName = name;
|
| | | renamePlayerName.ItemIndex = (byte)GetRenameToolIndex();
|
| | | renamePlayerName.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag;
|
| | | GameNetSystem.Instance.SendInfo(renamePlayerName);
|
| | | }
|
| | |
|
| | | });
|
| | | }
|
| | |
|
| | | private bool CheckNameLengthLimit(string _value)
|
| | | {
|
| | | var _chs = Regex.Replace(_value, "[^\u4e00-\u9fa5]", string.Empty);
|
| | | if (_chs.Length > GeneralConfig.Instance.playerNameLength / 3)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (_value.Length > 6)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 267817e3e5c4b0e44b2b6c98eca954bc |
| | | timeCreated: 1538028978 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | quickSettingDic.Add(QuickSettingType.FairyLeagueGuide, new QuickSettingRange(QuickSettingType.FairyLeagueGuide, 1)); |
| | | quickSettingDic.Add(QuickSettingType.AutoUseXp, new QuickSettingRange(QuickSettingType.AutoUseXp, 1)); |
| | | quickSettingDic.Add(QuickSettingType.SpAnim, new QuickSettingRange(QuickSettingType.SpAnim, 10)); |
| | | quickSettingDic.Add(QuickSettingType.TreasureHighestAnim, new QuickSettingRange(QuickSettingType.TreasureHighestAnim, 10)); |
| | | setting = new string(UCharacter, 100); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; |
| | | } |
| | |
| | | FairyLeagueGuide, |
| | | AutoUseXp, |
| | | SpAnim, |
| | | TreasureHighestAnim |
| | | } |
| | | public struct QuickSettingRange |
| | | { |
| | |
| | | {
|
| | | if (itemModel[i].EquipPlace == GodBeastPart)
|
| | | {
|
| | | ItemCellModel ItemModel = new ItemCellModel(itemModel[i].itemId, true, 0, itemModel[i].itemInfo.IsBind);
|
| | | ItemCellModel ItemModel = new ItemCellModel(itemModel[i].itemId, true, 0, 0);//默认显示不上锁
|
| | | m_ItemCell.Init(ItemModel);
|
| | | m_ItemCell.cellBtn.RemoveAllListeners();
|
| | | int type = i;
|
| | |
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzItem, Index);
|
| | | m_ItemCell.Init(itemModel);
|
| | | m_ItemCell.bindIcon.gameObject.SetActive(false);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | TextNumber.gameObject.SetActive(false);
|
| | | if (IudetDogzEquipPlus != null)
|
| | |
| | | _ItemColor = itemModelBack.chinItemModel.ItemColor;
|
| | | }
|
| | | }
|
| | | if (Type >= dogz_model.DogzAssistDefaultCnt && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
|
| | | if (Type >= dogz_model.curSumAssistNum && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | return;
|
| | |
| | | SFXController lockEffect;
|
| | | SFXController challengeSfx;
|
| | | SFXController specialSfx;
|
| | | SFXController highestSfx;
|
| | |
|
| | | public Treasure3DConfig paramConfig { get; set; }
|
| | |
|
| | |
| | | RequestBottom();
|
| | | RequestBackLight();
|
| | | RequestRedpoint();
|
| | | RequestHighestEffect();
|
| | | UpdateTreasureState();
|
| | | UpdateParam();
|
| | | RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent;
|
| | |
| | | RecycleCollectingSfx();
|
| | | RecycleRedpoint();
|
| | | RecycleCondition();
|
| | | RecycleHighestEffect();
|
| | | RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent;
|
| | | }
|
| | | interactProcessor.SetActive(_active);
|
| | |
| | | CloserState();
|
| | | }
|
| | | UpdateParam();
|
| | | }
|
| | |
|
| | | public void UpdateTreasureStage()
|
| | | {
|
| | | RequestHighestEffect();
|
| | | }
|
| | |
|
| | | private void RequestBackLight()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void RequestHighestEffect()
|
| | | {
|
| | | RecycleHighestEffect();
|
| | | Treasure _treasure;
|
| | | if (category == TreasureCategory.Human &&
|
| | | model.TryGetTreasure(treasureId, out _treasure) && _treasure.IsHighestStage
|
| | | && !model.GetTreasureFinishAnim(treasureId))
|
| | | {
|
| | | highestSfx = SFXPlayUtility.Instance.Play(5198, root);
|
| | | if (highestSfx != null)
|
| | | {
|
| | | highestSfx.duration = 0;
|
| | | LayerUtility.SetLayer(highestSfx.gameObject, LayerUtility.UILayer, true);
|
| | | highestSfx.transform.localPosition = Vector3.zero;
|
| | | highestSfx.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void RecycleHighestEffect()
|
| | | {
|
| | | if (highestSfx != null)
|
| | | {
|
| | | highestSfx.gameObject.SetActive(false);
|
| | | SFXPlayUtility.Instance.Release(highestSfx);
|
| | | highestSfx = null;
|
| | | }
|
| | | }
|
| | |
|
| | | public void CloserState()
|
| | | {
|
| | | RecycleBottom();
|
| | |
| | | RecycleLockEffect();
|
| | | RecycleRedpoint();
|
| | | RecycleCondition();
|
| | | RecycleHighestEffect();
|
| | | RequestSpecialEffect();
|
| | |
|
| | | Treasure _treasure;
|
| | |
| | | RequestBottom();
|
| | | RequestName();
|
| | | RequestRedpoint();
|
| | | RequestHighestEffect();
|
| | | UpdateTreasureState();
|
| | | RecycleSpecialEffect();
|
| | | UpdateParam();
|
| | |
| | | UI3DTreasureSelectStage.Instance.CompleteUnlock();
|
| | | model.treasureGotoId = 0;
|
| | | }
|
| | |
|
| | | public void PlayHighestShow()
|
| | | {
|
| | | RecycleHighestEffect();
|
| | | var _effect = SFXPlayUtility.Instance.Play(5197, root);
|
| | | if (_effect != null)
|
| | | {
|
| | | LayerUtility.SetLayer(_effect.gameObject, LayerUtility.UILayer, true);
|
| | | _effect.transform.LookAt(UI3DTreasureSelectStage.Instance.center);
|
| | | _effect.transform.localPosition = Vector3.zero;
|
| | | _effect.duration = 3.0f;
|
| | | }
|
| | | SnxxzGame.Instance.StartCoroutine(Co_HighestShow());
|
| | | }
|
| | |
|
| | | IEnumerator Co_HighestShow()
|
| | | {
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(2.2f);
|
| | | model.SetTreasureFinishAnim(treasureId, false);
|
| | | if (display)
|
| | | {
|
| | | UpdateTreasureStage();
|
| | | }
|
| | | UI3DTreasureSelectStage.Instance.ReCheckTreasureHighest();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | QuickSetting.Instance.SendPackage();
|
| | | }
|
| | |
|
| | | public bool GetTreasureFinishAnim(int _treasureId)
|
| | | {
|
| | | if (_treasureId == 101)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | var index = list.IndexOf(_treasureId);
|
| | | if (index == -1)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | uint value = 0;
|
| | | uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | return MathUtility.GetBitValue(value, (ushort)index);
|
| | | }
|
| | |
|
| | | public void SetTreasureFinishAnim(int _treasureId, bool anim = true)
|
| | | {
|
| | | var list = GetTreasureCategory(TreasureCategory.Human);
|
| | | var index = list.IndexOf(_treasureId);
|
| | | if (index == -1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | uint value = 0;
|
| | | uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, 0), out value);
|
| | | int bitValue = MathUtility.SetBitValue((int)value, (ushort)index, anim);
|
| | | QuickSetting.Instance.SetQuickSetting(QuickSetting.QuickSettingType.TreasureHighestAnim, bitValue);
|
| | | QuickSetting.Instance.SendPackage();
|
| | | }
|
| | |
|
| | | public bool TryGetUnlockShowTreasure(out int _id)
|
| | | {
|
| | | _id = 0;
|
| | |
| | | _up = true;
|
| | | }
|
| | | treasure.UpdateTreasureLevelExp(package.InfoList[i].LV, (int)package.InfoList[i].Exp, package.InfoList[i].State == 1);
|
| | | if (serverInited && treasure.IsHighestStage)
|
| | | {
|
| | | SetTreasureFinishAnim(treasure.id);
|
| | | }
|
| | | if (treasureLevelProgressUpdateEvent != null)
|
| | | {
|
| | | treasureLevelProgressUpdateEvent(treasure.id);
|
| | |
| | | m_HumanBtn.onClick.AddListener(() =>
|
| | | {
|
| | | if (UI3DTreasureSelectStage.Instance.currentCategory == TreasureCategory.Human
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.IsCloser)
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.IsCloser
|
| | | || UI3DTreasureSelectStage.Instance.treasureFinishShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | m_DemonBtn.onClick.AddListener(() =>
|
| | | {
|
| | | if (UI3DTreasureSelectStage.Instance.currentCategory == TreasureCategory.Demon
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.IsCloser)
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.IsCloser
|
| | | || UI3DTreasureSelectStage.Instance.treasureFinishShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | m_FairyBtn.onClick.AddListener(() =>
|
| | | {
|
| | | if (UI3DTreasureSelectStage.Instance.currentCategory == TreasureCategory.Fairy
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.IsCloser)
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.IsCloser
|
| | | || UI3DTreasureSelectStage.Instance.treasureFinishShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | });
|
| | | m_BackBtn.onClick.AddListener(() =>
|
| | | {
|
| | | if (UI3DTreasureSelectStage.Instance.UnlockShowing)
|
| | | if (UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.treasureFinishShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | UI3DTreasureSelectStage.Instance.UnlockShowing = false;
|
| | | UI3DTreasureSelectStage.Instance.treasureFinishShowing = false;
|
| | | if (!UI3DTreasureSelectStage.Instance.IsOpen)
|
| | | {
|
| | | UI3DTreasureSelectStage.Instance.Open(false, model.currentCategory);
|
| | |
| | | UI3DTreasureSelectStage.Instance.OnCameraStartEvent += OnCameraStartEvent;
|
| | | UI3DTreasureSelectStage.Instance.OnCameraBackComplete += OnCameraBackComplete;
|
| | | UI3DTreasureSelectStage.Instance.OnUnlockComplete += OnUnlockComplete;
|
| | | UI3DTreasureSelectStage.Instance.OnHighestComplete += OnHighestComplete;
|
| | | UI3DTreasureSelectStage.Instance.startAnimation += StartAnimation;
|
| | | m_TreasureDrag.OnValueChange += OnValueChange;
|
| | | m_TreasureDrag.OnDragComplete += OnDragComplete;
|
| | | m_TreasureDrag.OnDragBegine += OnDragBegine;
|
| | |
| | | UI3DTreasureSelectStage.Instance.OnCameraStartEvent -= OnCameraStartEvent;
|
| | | UI3DTreasureSelectStage.Instance.OnCameraBackComplete -= OnCameraBackComplete;
|
| | | UI3DTreasureSelectStage.Instance.OnUnlockComplete -= OnUnlockComplete;
|
| | | UI3DTreasureSelectStage.Instance.OnHighestComplete -= OnHighestComplete;
|
| | | UI3DTreasureSelectStage.Instance.startAnimation -= StartAnimation;
|
| | | m_TreasureDrag.OnValueChange -= OnValueChange;
|
| | | m_TreasureDrag.OnDragComplete -= OnDragComplete;
|
| | | m_TreasureDrag.OnDragBegine -= OnDragBegine;
|
| | |
| | | private void UpdateButtonState()
|
| | | {
|
| | | var _closer = UI3DTreasureSelectStage.Instance.IsCloser
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing;
|
| | | if (UI3DTreasureSelectStage.Instance.UnlockShowing)
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing|| UI3DTreasureSelectStage.Instance.treasureFinishShowing;
|
| | | if (UI3DTreasureSelectStage.Instance.UnlockShowing
|
| | | || UI3DTreasureSelectStage.Instance.treasureFinishShowing)
|
| | | {
|
| | | m_BackBtn.gameObject.SetActive(false);
|
| | | }
|
| | |
| | | m_FairyBtn.gameObject.SetActive(!_closer);
|
| | | }
|
| | |
|
| | | private void StartAnimation()
|
| | | {
|
| | | UpdateButtonState();
|
| | | }
|
| | |
|
| | | private void OnHighestComplete()
|
| | | {
|
| | | UpdateButtonState();
|
| | | }
|
| | |
|
| | | private void OnUnlockComplete()
|
| | | {
|
| | | UpdateButtonState();
|
| | |
| | | public bool CloserComplete { get; private set; }
|
| | | public int jumpTreasure { get; private set; }
|
| | | public bool UnlockShowing { get; set; }
|
| | | public bool treasureFinishShowing { get; set; }
|
| | | public bool Preloading { get; private set; }
|
| | |
|
| | | public GameObject currentTreasureTitle
|
| | |
| | | public event Action OnCameraCloserComplete;
|
| | | public event Action OnCameraBackEvent;
|
| | | public event Action OnUnlockComplete;
|
| | | public event Action OnHighestComplete;
|
| | | public event Action startAnimation;
|
| | |
|
| | | private Dictionary<TreasureCategory, List<TreasureComponent>> m_Treasures = new Dictionary<TreasureCategory, List<TreasureComponent>>();
|
| | | private Dictionary<TreasureCategory, bool> m_PreloadDict = new Dictionary<TreasureCategory, bool>();
|
| | |
| | | }
|
| | |
|
| | | model.treasureStateChangeEvent += TreasureStateChangeEvent;
|
| | | model.treasureStageUpEvent += TreasureStageUpEvent;
|
| | | }
|
| | |
|
| | | IEnumerator Co_PreLoad(TreasureCategory _category, Action callback)
|
| | |
| | | {
|
| | | HideAllTreasure();
|
| | | CloseRenderCamera();
|
| | |
|
| | | IsCloser = false;
|
| | | CloserComplete = false;
|
| | | UnlockShowing = false;
|
| | | treasureFinishShowing = false;
|
| | | IsOpen = false;
|
| | | jumping = false;
|
| | | Preloading = false;
|
| | | jumpTreasure = 0;
|
| | |
|
| | | var movecomponent = m_CameraControl.GetComponent<SmoothMove>();
|
| | | if (movecomponent != null)
|
| | | {
|
| | |
| | | }
|
| | | m_CameraControl.localPosition = m_StartPosition;
|
| | |
|
| | | IsCloser = false;
|
| | | CloserComplete = false;
|
| | | UnlockShowing = false;
|
| | | IsOpen = false;
|
| | | jumping = false;
|
| | | Preloading = false;
|
| | | jumpTreasure = 0;
|
| | |
|
| | | CameraController.Instance.CameraObject.gameObject.SetActive(true);
|
| | | m_Camera.enabled = false;
|
| | | WindowCenter.Instance.uiRoot.baseCanvas.gameObject.SetActive(true);
|
| | |
|
| | | model.treasureStateChangeEvent -= TreasureStateChangeEvent;
|
| | | model.treasureStageUpEvent -= TreasureStageUpEvent;
|
| | | model.SetTreasureUnlockShow(currentCategory, 0);
|
| | |
|
| | | if (currentTreasureTitle != null)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void TreasureStageUpEvent(int _id)
|
| | | {
|
| | | var _list = m_Treasures[currentCategory];
|
| | | var _component = _list.Find((x) =>
|
| | | {
|
| | | return x.treasureId == _id;
|
| | | });
|
| | | if (_component != null && _component.display)
|
| | | {
|
| | | _component.UpdateTreasureStage();
|
| | | _component.SetLayer(CloserComplete ? LayerUtility.DefaultLayer : LayerUtility.UILayer);
|
| | | }
|
| | | }
|
| | |
|
| | | public void SelectTreasureCategory(TreasureCategory _type, bool _closer = false)
|
| | | {
|
| | | presentSelectIndex = 0;
|
| | | UnlockShowing = false;
|
| | | treasureFinishShowing = false;
|
| | |
|
| | | currentCategory = _type;
|
| | | model.currentCategory = currentCategory;
|
| | |
| | | {
|
| | | var _treasure = 0;
|
| | | int _index = -1;
|
| | | if (model.GetTreasureUnlockShow(currentCategory) != 0)
|
| | | if (CheckTreasureFinish(out _treasure))
|
| | | {
|
| | | treasureFinishShowing = true;
|
| | | }
|
| | | else if (model.GetTreasureUnlockShow(currentCategory) != 0)
|
| | | {
|
| | | _treasure = model.GetTreasureUnlockShow(currentCategory);
|
| | | model.treasureGotoId = _treasure;
|
| | |
| | | });
|
| | | }
|
| | | return _index;
|
| | | }
|
| | |
|
| | | private bool CheckTreasureFinish(out int treasureId)
|
| | | {
|
| | | treasureId = 0;
|
| | | if (currentCategory != TreasureCategory.Human)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var list = model.GetTreasureCategory(TreasureCategory.Human);
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (list[i] == 101)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | Treasure treasure;
|
| | | if (model.TryGetTreasure(list[i], out treasure)
|
| | | && treasure.IsHighestStage && model.GetTreasureFinishAnim(list[i]))
|
| | | {
|
| | | treasureId = list[i];
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | int Compare(int x, int y)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public bool AllowPointClick()
|
| | | {
|
| | | if (IsCloser || UnlockShowing || jumping
|
| | | || draging || BossShowModel.Instance.BossShowing
|
| | | || treasureFinishShowing)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public void OnPointDownTreasure(int _treasureId)
|
| | | {
|
| | | if (IsCloser || UnlockShowing || jumping || draging || BossShowModel.Instance.BossShowing)
|
| | | if (!AllowPointClick())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | var _component = m_Treasures[currentCategory][presentSelectIndex];
|
| | | _component.PlayUnlockShow();
|
| | | }
|
| | | else if (treasureFinishShowing)
|
| | | {
|
| | | var _component = m_Treasures[currentCategory][presentSelectIndex];
|
| | | _component.PlayHighestShow();
|
| | | }
|
| | | jumpTreasure = 0;
|
| | | }
|
| | | #endregion
|
| | |
| | |
|
| | | public void BegineDrag()
|
| | | {
|
| | | if (IsCloser || UnlockShowing)
|
| | | if (IsCloser || UnlockShowing || treasureFinishShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | |
|
| | | private void CameraBackComplete()
|
| | | {
|
| | | if (!IsOpen)
|
| | | {
|
| | | return;
|
| | | }
|
| | | IsCloser = false;
|
| | | if (OnCameraBackComplete != null)
|
| | | {
|
| | | OnCameraBackComplete();
|
| | | }
|
| | | IsCloser = false;
|
| | | if (!IsOpen)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var _list = m_Treasures[currentCategory];
|
| | | for (int i = 0; i < _list.Count; i++)
|
| | | {
|
| | | _list[i].SetLayer(LayerUtility.UILayer);
|
| | | }
|
| | |
|
| | | ReCheckTreasureHighest();
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public void ReCheckTreasureHighest()
|
| | | {
|
| | | treasureFinishShowing = false;
|
| | | if (!IsOpen)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var treasureId = 0;
|
| | | if (CheckTreasureFinish(out treasureId))
|
| | | {
|
| | | treasureFinishShowing = true;
|
| | | }
|
| | | else if (model.GetTreasureUnlockShow(currentCategory) != 0)
|
| | | {
|
| | | UnlockShowing = true;
|
| | | treasureId = model.GetTreasureUnlockShow(currentCategory);
|
| | | model.treasureGotoId = treasureId;
|
| | | }
|
| | | if (treasureId != 0)
|
| | | {
|
| | | var _index = m_Treasures[currentCategory].FindIndex((x) =>
|
| | | {
|
| | | return x.treasureId == treasureId;
|
| | | });
|
| | | if (_index == presentSelectIndex)
|
| | | {
|
| | | var _component = m_Treasures[currentCategory][presentSelectIndex];
|
| | | if (UnlockShowing)
|
| | | {
|
| | | _component.PlayUnlockShow();
|
| | | }
|
| | | else if (treasureFinishShowing)
|
| | | {
|
| | | _component.PlayHighestShow();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | Goto(_index);
|
| | | }
|
| | | if (startAnimation != null)
|
| | | {
|
| | | startAnimation();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (OnHighestComplete != null)
|
| | | {
|
| | | OnHighestComplete();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | IsRotateBool = true;
|
| | | _isRotate = true;
|
| | | }
|
| | | //外部调用,设置停止角度
|
| | | public void SetAngle(float angle)
|
| | | {
|
| | | Angle = angle;
|
| | | } |
| | | //外部调用,设置停止角度 |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, September 27, 2018 |
| | | //-------------------------------------------------------- |
| | |
|
| | | using LitJson;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig; |
| | | using UnityEngine;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | { |
| | | |
| | | public class WheelOfFortuneModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public class AngleClass
|
| | | {
|
| | | public float AngleStart;
|
| | | public float AngleEnd;
|
| | | }
|
| | |
|
| | | public int Lattice = -1;//格子
|
| | | public int Number = 0;//次数
|
| | | public int NeedJade = 0;//需要仙玉
|
| | | public float AngleSave = 0f;//角度记录
|
| | | public Dictionary<int, AngleClass> AngleDic = new Dictionary<int, AngleClass>();
|
| | | private int[][] AngleList;
|
| | | public event Action<float> WheelOfFortuneUpdate;
|
| | |
|
| | | private string StrKey = string.Empty;
|
| | | private bool IsOk = false;
|
| | | public override void Init()
|
| | | {
|
| | | var BindJadewheel = Config.Instance.Get<FuncConfigConfig>("BindJadeWheelCfg");
|
| | | NeedJade = int.Parse(BindJadewheel.Numerical1);
|
| | | AngleList = JsonMapper.ToObject<int[][]>(BindJadewheel.Numerical5);
|
| | | for (int i = 0; i < AngleList.Length; i++)
|
| | | {
|
| | | if (AngleDic.Count <= 0)
|
| | | {
|
| | | int Type = i + 1;
|
| | | AngleClass angleClass = new AngleClass();
|
| | | angleClass.AngleStart = AngleList[i][0];
|
| | | angleClass.AngleEnd = AngleList[i][1];
|
| | | AngleDic.Add(Type, angleClass);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | IsOk = false;
|
| | | |
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | IsOk = true;
|
| | | StrKey = "IsOpenFiaryJadeRedPoint" + PlayerDatas.Instance.baseData.PlayerID;
|
| | | AngleSave = LocalSave.GetFloat(StrKey);
|
| | | }
|
| | |
|
| | | public void BindJadeWheelResult(HA324_tagMCBindJadeWheelResult Info)
|
| | | {
|
| | | Lattice = Info.Index;
|
| | | Number = Info.Cnt;
|
| | | if (IsOk)
|
| | | {
|
| | | if (AngleDic.ContainsKey(Lattice))
|
| | | {
|
| | |
|
| | | float flo = UnityEngine.Random.Range(AngleDic[Lattice].AngleStart + 0.05f, AngleDic[Lattice].AngleEnd - 0.05f);
|
| | | LocalSave.SetFloat(StrKey, flo);
|
| | | AngleSave = LocalSave.GetFloat(StrKey);
|
| | | }
|
| | | if (WheelOfFortuneUpdate != null)
|
| | | {
|
| | | WheelOfFortuneUpdate(AngleSave);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | public void StartTheDraw()//开始抽奖
|
| | | {
|
| | | CA517_tagCMStartBindJadeWheel _tagC517 = new CA517_tagCMStartBindJadeWheel();
|
| | | GameNetSystem.Instance.SendInfo(_tagC517);
|
| | | }
|
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7a605a41a6e674a43b7394d602e4c929 |
| | | timeCreated: 1538032790 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] Button m_LotteryBtn;
|
| | | [SerializeField] RotatePointer m_RotatePointer; |
| | | [SerializeField] Toggle m_Toggle; |
| | | [SerializeField] Button m_CloseBtn; |
| | | [SerializeField] Button m_CloseBtn;
|
| | | VipModel m_Vipmodel;
|
| | | VipModel vipmodel { get { return m_Vipmodel ?? (m_Vipmodel = ModelCenter.Instance.GetModel<VipModel>()); } } |
| | | WheelOfFortuneModel wheelOfFortuneModel { get { return ModelCenter.Instance.GetModel<WheelOfFortuneModel>(); } }
|
| | | private int remainingTimes = 0;//剩余次数 |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | {
|
| | | IsLottery();//判断是否拥有次数 |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | wheelOfFortuneModel.WheelOfFortuneUpdate += WheelOfFortuneUpdate; |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | {
|
| | | wheelOfFortuneModel.WheelOfFortuneUpdate -= WheelOfFortuneUpdate; |
| | | }
|
| | |
|
| | | private void WheelOfFortuneUpdate(float Angel)
|
| | | {
|
| | | IsLottery();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | |
| | | private void OnClickButton()
|
| | | {
|
| | | wheelOfFortuneModel.StartTheDraw();//开始抽奖
|
| | | m_RotatePointer.SetTime();
|
| | | } |
| | | private void OnClickToggle(bool _bool)
|
| | |
| | | if (_bool)
|
| | | {
|
| | | m_RotatePointer._isRotate = false;
|
| | | m_RotatePointer.SetAngle(m_RotatePointer.Angle);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | } |
| | | |
| | | private void IsLottery()
|
| | | {
|
| | | int LotteryNumber = vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.BindJadeWheel);
|
| | | if (LotteryNumber > wheelOfFortuneModel.Number)
|
| | | {
|
| | | remainingTimes = LotteryNumber - wheelOfFortuneModel.Number;
|
| | | m_LotteryBtn.interactable = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_LotteryBtn.interactable = false;
|
| | | }
|
| | | } |
| | | #endregion |
| | | |
| | |
|
| | | } |
| | | |
| | | } |
| | |
| | | RegisterModel<PrayForDurgModel>();
|
| | | RegisterModel<FeatureNoticeModel>();
|
| | | RegisterModel<AwardExchangeModel>();
|
| | | RegisterModel<WheelOfFortuneModel>();
|
| | | inited = true;
|
| | | }
|
| | |
|
| | |
| | | Hostile,
|
| | | }
|
| | |
|
| | | public enum RoleRenameResult
|
| | | {
|
| | | MoneyErr = 0, //金钱不足
|
| | | NameRuleErr = 1, //名字不合法
|
| | | NameLengErr = 2, //名字长度错误
|
| | | NameRepeatErr = 3, //重名
|
| | | RenameFailErr = 4, //改名失败
|
| | | RenameSuccess = 5, //成功
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// <para>无意义 0</para>
|
| | | /// <para>自己 1</para>
|
| | |
| | | DemonJar = 25,
|
| | | BossHomeAwardLimit = 27,
|
| | | DemonJarDouble = 28,
|
| | | BindJadeWheel=30,
|
| | | }
|
| | |
|
| | |
|