From 0d7482d5a0e8bf082abfb4b5bfbfee03597cdc3a Mon Sep 17 00:00:00 2001
From: lwb <q3213421wrwqr>
Date: 星期四, 25 二月 2021 15:43:08 +0800
Subject: [PATCH] 9527 去掉xlua

---
 System/Pet/PetModel.cs |  108 ++++++++++++++++++++++++++----------------------------
 1 files changed, 52 insertions(+), 56 deletions(-)

diff --git a/System/Pet/PetModel.cs b/System/Pet/PetModel.cs
index 64cf78f..6e5bf8f 100644
--- a/System/Pet/PetModel.cs
+++ b/System/Pet/PetModel.cs
@@ -22,7 +22,6 @@
         PetStone = 2,//鐏靛疇榄傜煶
     }
 
-    [XLua.CSharpCallLua]
     public interface IPetHorseAwaking
     {
         event Action onFuncStateUpdate;
@@ -31,7 +30,7 @@
         string GetPetHorseEffectNode(int id, int skinIndex);
     }
 
-    [XLua.LuaCallCSharp]
+
     public class PetModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
     {
         public Dictionary<int, int> _TagPetItem = new Dictionary<int, int>();//鍏充簬鐏靛吔榄傜煶
@@ -61,8 +60,7 @@
         private int PetDanExp = 0;//鐏靛疇涓圭粡楠�
         public List<int> ListEffectSkill = new List<int>();
         PackModel _playerPack;
-        PackModel playerPack
-        {
+        PackModel playerPack {
             get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
         }
 
@@ -397,15 +395,15 @@
         {
             foreach (var key in CultivateRedPoint.Keys)
             {
-               CultivateRedPoint[key].state = RedPointState.None;
+                CultivateRedPoint[key].state = RedPointState.None;
             }
             if (!FuncOpen.Instance.IsFuncOpen(6))
             {
-               return;
+                return;
             }
             if (_DicPetBack.Count <= 0)
             {
-               return;
+                return;
             }
             int GetPetId = 0;
             int petLv = 100;
@@ -413,70 +411,70 @@
             List<int> ListInt = new List<int>();
             for (int i = 0; i < Sortpet.Count; i++)
             {
-               int petID = Sortpet[i].ID;
-               int MaxLv = PetInfoConfig.Get(petID).MaxRank;
-               if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < MaxLv)
-               {
-                   int _NeedExp = PetClassCostConfig.GetPetIdAndRank(petID, _DicPetBack[petID].PetClass).UpNeedExp;
-                   int NeedExp = _NeedExp - _DicPetBack[petID].petExp;
-                   int NeedNumber = Mathf.CeilToInt((float)NeedExp / PetDanExp);
-                   if (itemCount >= NeedNumber)
-                   {
-                       ListInt.Add(petID);
-                   }
-               }
+                int petID = Sortpet[i].ID;
+                int MaxLv = PetInfoConfig.Get(petID).MaxRank;
+                if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < MaxLv)
+                {
+                    int _NeedExp = PetClassCostConfig.GetPetIdAndRank(petID, _DicPetBack[petID].PetClass).UpNeedExp;
+                    int NeedExp = _NeedExp - _DicPetBack[petID].petExp;
+                    int NeedNumber = Mathf.CeilToInt((float)NeedExp / PetDanExp);
+                    if (itemCount >= NeedNumber)
+                    {
+                        ListInt.Add(petID);
+                    }
+                }
             }
 
             foreach (var key in _DicPetBack.Keys)//鍥犱负鏈夋垚灏变换鍔¢檺鍒舵墍鏈� 绗竴鍙潗楠戠孩鐐归�昏緫鐗规畩鍐�
             {
-               if (DicDefaultPet.ContainsKey(key) && DicDefaultPet[key] > _DicPetBack[key].PetClass
-                   && itemCount > 0 && CultivateRedPoint.ContainsKey(key))
-               {
-                   CultivateRedPoint[key].state = RedPointState.Simple;
-                   return;
-               }
+                if (DicDefaultPet.ContainsKey(key) && DicDefaultPet[key] > _DicPetBack[key].PetClass
+                    && itemCount > 0 && CultivateRedPoint.ContainsKey(key))
+                {
+                    CultivateRedPoint[key].state = RedPointState.Simple;
+                    return;
+                }
             }
             List<int> IntListSkill = new List<int>();
             for (int i = 0; i < ListInt.Count; i++)//閫夋嫨鍑哄崌绾х伒瀹犵瓑绾ф渶浣庝笖鏈夋妧鑳芥湭瑙i攣鐨勪笖缁忛獙鏈�鎺ヨ繎
             {
-               if (_DicPetBack.ContainsKey(ListInt[i]))
-               {
-                   var PetConfig = PetInfoConfig.Get(ListInt[i]);
-                   if (PetConfig == null)
-                   {
-                       return;
-                   }
-                   int[] SkillUnLockInt = PetConfig.SkillUnLock;
-                   int SkillLvMax = SkillUnLockInt[(SkillUnLockInt.Length - 1)];
-                   if (_DicPetBack[(ListInt[i])].PetClass < SkillLvMax)
-                   {
-                       IntListSkill.Add((ListInt[i]));
-                   }
-               }
+                if (_DicPetBack.ContainsKey(ListInt[i]))
+                {
+                    var PetConfig = PetInfoConfig.Get(ListInt[i]);
+                    if (PetConfig == null)
+                    {
+                        return;
+                    }
+                    int[] SkillUnLockInt = PetConfig.SkillUnLock;
+                    int SkillLvMax = SkillUnLockInt[(SkillUnLockInt.Length - 1)];
+                    if (_DicPetBack[(ListInt[i])].PetClass < SkillLvMax)
+                    {
+                        IntListSkill.Add((ListInt[i]));
+                    }
+                }
             }
             int SkillPetId = GetRedPointPetID(IntListSkill);
             if (SkillPetId != 0 && CultivateRedPoint.ContainsKey(SkillPetId))
             {
-               CultivateRedPoint[SkillPetId].state = RedPointState.Simple;
-               return;
+                CultivateRedPoint[SkillPetId].state = RedPointState.Simple;
+                return;
             }
 
 
             for (int i = 0; i < ListInt.Count; i++)//閫夋嫨鍑虹瓑绾ф渶浣庣殑鐏靛疇
             {
-               if (_DicPetBack.ContainsKey(ListInt[i]))
-               {
-                   if (_DicPetBack[(ListInt[i])].PetClass < petLv)
-                   {
-                       petLv = _DicPetBack[(ListInt[i])].PetClass;
-                       GetPetId = (ListInt[i]);
-                   }
-               }
+                if (_DicPetBack.ContainsKey(ListInt[i]))
+                {
+                    if (_DicPetBack[(ListInt[i])].PetClass < petLv)
+                    {
+                        petLv = _DicPetBack[(ListInt[i])].PetClass;
+                        GetPetId = (ListInt[i]);
+                    }
+                }
             }
             if (GetPetId != 0 && CultivateRedPoint.ContainsKey(GetPetId))
             {
-               CultivateRedPoint[GetPetId].state = RedPointState.Simple;
-               return;
+                CultivateRedPoint[GetPetId].state = RedPointState.Simple;
+                return;
             }
         }
 
@@ -1004,16 +1002,14 @@
             return _DicPetBack.ContainsKey(petId);
         }
 
-        public int GetPetHorseEffect(int id,int skinIndex)
+        public int GetPetHorseEffect(int id, int skinIndex)
         {
-            var petHorseAwaking = LuaUtility.Global.Get<IPetHorseAwaking>("PetHorseAwakingModel");
-            return petHorseAwaking.GetPetHorseEffect(id, skinIndex);
+            return ILRuntimeUtility.Instance.ModelInvoke<int>("PetHorseAwakingModel", "GetPetHorseEffect", id, skinIndex);
         }
 
         public string GetPetHorseEffectNode(int id, int skinIndex)
         {
-            var petHorseAwaking = LuaUtility.Global.Get<IPetHorseAwaking>("PetHorseAwakingModel");
-            return petHorseAwaking.GetPetHorseEffectNode(id, skinIndex);
+            return ILRuntimeUtility.Instance.ModelInvoke<string>("PetHorseAwakingModel", "GetPetHorseEffectNode", id, skinIndex);
         }
     }
 }

--
Gitblit v1.8.0