Guest User

Untitled

a guest
May 3rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.66 KB | None | 0 0
  1. using HSGameEngine.GameEngine.Common;
  2. using HSGameEngine.GameEngine.Logic;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Xml.Linq;
  6. using UnityEngine;
  7.  
  8. public class MonsterVO
  9. {
  10.     public int ID;
  11.  
  12.     public int PicCode;
  13.  
  14.     public string ResName;
  15.  
  16.     public string YouShou;
  17.  
  18.     public string ZuoShou;
  19.  
  20.     public float Scale;
  21.  
  22.     public int ShaderID;
  23.  
  24.     public string GuaJieDian;
  25.  
  26.     public string GuaJieTeXiao;
  27.  
  28.     public string SName;
  29.  
  30.     public int MapCode;
  31.  
  32.     public string Talk;
  33.  
  34.     public int SeedRange;
  35.  
  36.     public int MonsterType;
  37.  
  38.     public int[] XueTiaoType;
  39.  
  40.     public int Display;
  41.  
  42.     public string PlaySound;
  43.  
  44.     public string AttackSound;
  45.  
  46.     public string HitSound;
  47.  
  48.     public string DieSound;
  49.  
  50.     public int ComeAnimation;
  51.  
  52.     public int DieAnimation;
  53.  
  54.     public Vector3 CollideCenter = Vector3.zero;
  55.  
  56.     public Vector3 CollideSize = Vector3.zero;
  57.  
  58.     public bool IsCollide;
  59.  
  60.     private static Dictionary<string, int> _PropertyIndexDict;
  61.  
  62.     public static Dictionary<string, int> PropertyIndexDict
  63.     {
  64.         get
  65.         {
  66.             if (MonsterVO._PropertyIndexDict == null)
  67.             {
  68.                 MonsterVO._PropertyIndexDict = new Dictionary<string, int>();
  69.                 MonsterVO._PropertyIndexDict.Add("ID", 0);
  70.                 MonsterVO._PropertyIndexDict.Add("PicCode", 2);
  71.                 MonsterVO._PropertyIndexDict.Add("ResName", 3);
  72.                 MonsterVO._PropertyIndexDict.Add("YouShou", 4);
  73.                 MonsterVO._PropertyIndexDict.Add("ZuoShou", 5);
  74.                 MonsterVO._PropertyIndexDict.Add("Scale", 6);
  75.                 MonsterVO._PropertyIndexDict.Add("ShaderID", 7);
  76.                 MonsterVO._PropertyIndexDict.Add("GuaJieDian", 8);
  77.                 MonsterVO._PropertyIndexDict.Add("GuaJieTeXiao", 9);
  78.                 MonsterVO._PropertyIndexDict.Add("SName", 12);
  79.                 MonsterVO._PropertyIndexDict.Add("MapCode", 13);
  80.                 MonsterVO._PropertyIndexDict.Add("Talk", 14);
  81.                 MonsterVO._PropertyIndexDict.Add("SeedRange", 41);
  82.                 MonsterVO._PropertyIndexDict.Add("MonsterType", 43);
  83.                 MonsterVO._PropertyIndexDict.Add("XueTiaoType", 44);
  84.                 MonsterVO._PropertyIndexDict.Add("Display", 49);
  85.                 MonsterVO._PropertyIndexDict.Add("PlaySound", 62);
  86.                 MonsterVO._PropertyIndexDict.Add("AttackSound", 63);
  87.                 MonsterVO._PropertyIndexDict.Add("HitSound", 64);
  88.                 MonsterVO._PropertyIndexDict.Add("DieSound", 65);
  89.                 MonsterVO._PropertyIndexDict.Add("ComeAnimation", 59);
  90.                 MonsterVO._PropertyIndexDict.Add("DieAnimation", 60);
  91.                 MonsterVO._PropertyIndexDict.Add("Collide", 66);
  92.             }
  93.             return MonsterVO._PropertyIndexDict;
  94.         }
  95.     }
  96.  
  97.     public void CopyFrom(XElement xml)
  98.     {
  99.         this.ID = Global.GetXElementAttributeInt(xml, "ID");
  100.         this.PicCode = Global.GetXElementAttributeInt(xml, "PicCode");
  101.         this.ResName = Global.GetXElementAttributeStr(xml, "ResName");
  102.         this.YouShou = Global.GetXElementAttributeStr(xml, "YouShou");
  103.         this.ZuoShou = Global.GetXElementAttributeStr(xml, "ZuoShou");
  104.         this.Scale = Global.GetXElementAttributeFloat(xml, "Scale");
  105.         this.ShaderID = Global.GetXElementAttributeInt(xml, "ShaderID");
  106.         this.GuaJieDian = Global.GetXElementAttributeStr(xml, "GuaJieDian");
  107.         this.GuaJieTeXiao = Global.GetXElementAttributeStr(xml, "GuaJieTeXiao");
  108.         this.SName = Global.GetXElementAttributeStr(xml, "SName");
  109.         this.MapCode = Global.GetXElementAttributeInt(xml, "MapCode");
  110.         this.Talk = Global.GetXElementAttributeStr(xml, "Talk");
  111.         this.SeedRange = Global.GetXElementAttributeInt(xml, "SeedRange");
  112.         this.MonsterType = Global.GetXElementAttributeInt(xml, "MonsterType");
  113.         this.XueTiaoType = Global.GetXElementAttributeIntArray(xml, "XueTiaoType", "*");
  114.         this.Display = Global.GetXElementAttributeInt(xml, "Display");
  115.         this.PlaySound = Global.GetXElementAttributeStr(xml, "PlaySound");
  116.         this.AttackSound = Global.GetXElementAttributeStr(xml, "AttackSound");
  117.         this.HitSound = Global.GetXElementAttributeStr(xml, "HitSound");
  118.         this.DieSound = Global.GetXElementAttributeStr(xml, "DieSound");
  119.         this.ComeAnimation = Global.GetXElementAttributeInt(xml, "ComeAnimation");
  120.         this.DieAnimation = Global.GetXElementAttributeInt(xml, "DieAnimation");
  121.         string[] array = Global.GetXElementAttributeStr(xml, "Collide").Split(new char[]
  122.         {
  123.             ';'
  124.         });
  125.         if (array.Length == 2)
  126.         {
  127.             string[] array2 = array[0].Split(new char[]
  128.             {
  129.                 ','
  130.             });
  131.             this.CollideCenter = new Vector3(Convert.ToSingle(array2[0]), Convert.ToSingle(array2[1]), Convert.ToSingle(array2[2]));
  132.             array2 = array[1].Split(new char[]
  133.             {
  134.                 ','
  135.             });
  136.             this.CollideSize = new Vector3(Convert.ToSingle(array2[0]), Convert.ToSingle(array2[1]), Convert.ToSingle(array2[2]));
  137.             this.IsCollide = true;
  138.         }
  139.     }
  140.  
  141.     public void CopyFrom(TrdGoodVOPairs pairs)
  142.     {
  143.         if (TrdGoodVOPairs.IsCopySpeedUp())
  144.         {
  145.             pairs.StartGoodVOCopySpeedUp();
  146.         }
  147.         this.ID = pairs.PropertyAtOfInt("ID");
  148.         this.PicCode = pairs.PropertyAtOfInt("PicCode");
  149.         this.ResName = pairs.PropertyAtOfStr("ResName");
  150.         this.YouShou = pairs.PropertyAtOfStr("YouShou");
  151.         this.ZuoShou = pairs.PropertyAtOfStr("ZuoShou");
  152.         this.Scale = ConvertExt.SafeConvertToFloat(pairs.PropertyAtOfStr("Scale"), 0f);
  153.         this.ShaderID = pairs.PropertyAtOfInt("ShaderID");
  154.         this.GuaJieDian = pairs.PropertyAtOfStr("GuaJieDian");
  155.         this.GuaJieTeXiao = pairs.PropertyAtOfStr("GuaJieTeXiao");
  156.         this.SName = pairs.PropertyAtOfStr("SName");
  157.         this.MapCode = pairs.PropertyAtOfInt("MapCode");
  158.         this.Talk = pairs.PropertyAtOfStr("Talk");
  159.         this.SeedRange = pairs.PropertyAtOfInt("ID");
  160.         this.SeedRange = pairs.PropertyAtOfInt("SeedRange");
  161.         this.MonsterType = pairs.PropertyAtOfInt("MonsterType");
  162.         this.XueTiaoType = ConvertExt.String2IntArray(pairs.PropertyAtOfStr("XueTiaoType"), ',');
  163.         this.Display = pairs.PropertyAtOfInt("Display");
  164.         this.PlaySound = pairs.PropertyAtOfStr("PlaySound");
  165.         this.AttackSound = pairs.PropertyAtOfStr("AttackSound");
  166.         this.HitSound = pairs.PropertyAtOfStr("HitSound");
  167.         this.DieSound = pairs.PropertyAtOfStr("DieSound");
  168.         this.ComeAnimation = pairs.PropertyAtOfInt("ComeAnimation");
  169.         this.DieAnimation = pairs.PropertyAtOfInt("DieAnimation");
  170.         string[] array = pairs.PropertyAtOfStr("Collide").Split(new char[]
  171.         {
  172.             ';'
  173.         });
  174.         if (array.Length == 3)
  175.         {
  176.             string[] array2 = array[0].Split(new char[]
  177.             {
  178.                 ','
  179.             });
  180.             this.CollideCenter = new Vector3(Convert.ToSingle(array2[0]), Convert.ToSingle(array2[1]), Convert.ToSingle(array2[2]));
  181.             array2 = array[1].Split(new char[]
  182.             {
  183.                 ','
  184.             });
  185.             this.CollideSize = new Vector3(Convert.ToSingle(array2[0]), Convert.ToSingle(array2[1]), Convert.ToSingle(array2[2]));
  186.             int num = ConvertExt.SafeConvertToInt32(array[2]);
  187.             this.IsCollide = (num == 1);
  188.         }
  189.     }
  190.  
  191.     public List<byte> ToByteLst(MonsterVO preVO, MonsterVO curVO)
  192.     {
  193.         return new List<byte>();
  194.     }
  195.  
  196.     public bool Equals(MonsterVO obj)
  197.     {
  198.         return obj != null;
  199.     }
  200. }
Advertisement
Add Comment
Please, Sign In to add comment