Core/GameEngine/Model/Config/VipPrivilegeConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Saturday, January 06, 2018 // [ Date ]: Thursday, September 27, 2018 //-------------------------------------------------------- using UnityEngine; @@ -11,22 +11,22 @@ 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() @@ -37,38 +37,38 @@ 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) Core/GameEngine/Model/Config/VipPrivilegeConfig.cs.meta
@@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: fe03774548a971a4186f518d32a9833c timeCreated: 1515213454 licenseType: Pro timeCreated: 1538035356 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA517_tagCMStartBindJadeWheel.cs
New file @@ -0,0 +1,16 @@ 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 () { } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA517_tagCMStartBindJadeWheel.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 7c268dd5f343f6c49b4c2621de591e6f timeCreated: 1538032691 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA324_tagMCBindJadeWheelResult.cs
New file @@ -0,0 +1,19 @@ 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); } } Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA324_tagMCBindJadeWheelResult.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: a0cbd69e7afc2474c8fd98b86348e72f timeCreated: 1538032691 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ServerPack/HA3_Function/HA324_tagMCBindJadeWheelResult.cs
New file @@ -0,0 +1,19 @@ 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); } } Core/NetworkPackage/ServerPack/HA3_Function/HA324_tagMCBindJadeWheelResult.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: d6ba1d40695294e48abc2835e49bc818 timeCreated: 1538032691 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Vip/VipInvest/RotatePointer.cs
@@ -91,11 +91,7 @@ IsRotateBool = true; _isRotate = true; } //外部调用,设置停止角度 public void SetAngle(float angle) { Angle = angle; } //外部调用,设置停止角度 } } System/Vip/VipInvest/WheelOfFortuneModel.cs
New file @@ -0,0 +1,99 @@ //-------------------------------------------------------- // [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); } } } System/Vip/VipInvest/WheelOfFortuneModel.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 7a605a41a6e674a43b7394d602e4c929 timeCreated: 1538032790 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Vip/VipInvest/WheelOfFortuneWin.cs
@@ -16,7 +16,11 @@ [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() { @@ -30,23 +34,32 @@ } 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) @@ -54,7 +67,6 @@ if (_bool) { m_RotatePointer._isRotate = false; m_RotatePointer.SetAngle(m_RotatePointer.Angle); } else { @@ -62,8 +74,22 @@ } } 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 } } System/WindowBase/ModelCenter.cs
@@ -195,6 +195,7 @@ RegisterModel<PrayForDurgModel>(); RegisterModel<FeatureNoticeModel>(); RegisterModel<AwardExchangeModel>(); RegisterModel<WheelOfFortuneModel>(); inited = true; } Utility/EnumHelper.cs
@@ -1095,6 +1095,7 @@ DemonJar = 25, BossHomeAwardLimit = 27, DemonJarDouble = 28, BindJadeWheel=30, }