| //-------------------------------------------------------- | 
| //    [Author]:           第二世界 | 
| //    [  Date ]:           Tuesday, November 21, 2017 | 
| //-------------------------------------------------------- | 
| using UnityEngine; | 
| using System.Collections; | 
| using UnityEngine.UI; | 
| using System; | 
|   | 
| using System.Collections.Generic; | 
|   | 
| namespace vnxbqy.UI { | 
|      | 
|    | 
|      | 
|     public class PKModel : Model,IBeforePlayerDataInitialize,IAfterPlayerDataInitialize | 
|     { | 
|         BuffModel m_BuffModel; | 
|         BuffModel Buffmodel | 
|         { | 
|             get | 
|             { | 
|                 return m_BuffModel ?? (m_BuffModel = ModelCenter.Instance.GetModel<BuffModel>()); | 
|             } | 
|         } | 
|   | 
|         public override void Init() | 
|         { | 
|         } | 
|   | 
|         public override void UnInit() | 
|         { | 
|         } | 
|   | 
|         public void OnAfterPlayerDataInitialize() | 
|         { | 
|             //StageLoad.Instance.onStageLoadFinish += onStageLoadFinish; | 
|         } | 
|   | 
|         public void OnBeforePlayerDataInitialize() | 
|         { | 
|            // StageLoad.Instance.onStageLoadFinish -= onStageLoadFinish; | 
|         } | 
|   | 
|         private void onStageLoadFinish() | 
|         { | 
|             int MapID = PlayerDatas.Instance.baseData.MapID; | 
|             var config = MapConfig.Get(MapID); | 
|   | 
|             if (config!=null) | 
|             { | 
|                 if (config.Camp == Buffmodel.PkType) | 
|                 { | 
|                     return; | 
|                 } | 
|   | 
|                 C030A_tagCChangeAttackMode _proto = new C030A_tagCChangeAttackMode(); | 
|                 _proto.Mode = (byte)((E_AttackMode)config.Camp); | 
|                 GameNetSystem.Instance.SendInfo(_proto); | 
|                 if (config.Camp == 5) | 
|                     SysNotifyMgr.Instance.ShowTip("MapType_ATK1"); | 
|                 else if (config.Camp == 2) | 
|                     SysNotifyMgr.Instance.ShowTip("MapType_ATK2"); | 
|               | 
|             } | 
|             else | 
|             { | 
|                 DebugEx.LogError("没有获取到地图表中响应的地图ID"+ MapID); | 
|             } | 
|                 | 
|         } | 
|   | 
|         List<int> _list = new List<int>(); | 
|         public List<int> GetArea(int atkType)//二进制解析 | 
|         { | 
|             _list.Clear(); | 
|             for (int i = 0; i < 10; i++) | 
|             { | 
|                 if ((atkType & (1 << i)) != 0) | 
|                 { | 
|                     _list.Add(i); | 
|                 } | 
|             } | 
|             return _list; | 
|   | 
|         } | 
|   | 
|   | 
|     } | 
|   | 
| } |