private void BuildSkills(int nActorSkillID) { var rSymbolObjs = GPCSkillConfig.Instance.GetActorSkill(nActorSkillID); this.Skills = new List <GPCSkill>(); if (rSymbolObjs == null) { return; } for (int i = 0; i < rSymbolObjs.Count; i++) { List <GamePlayComponent> rComps = new List <GamePlayComponent>(); for (int j = 0; j < rSymbolObjs[i].Bodies.Count; j++) { var rCompType = HotfixReflectAssists.GetType("Game.Knight." + rSymbolObjs[i].Bodies[j].Identifer.Value); var rComp = HotfixReflectAssists.Construct( rCompType, this, rSymbolObjs[i].Bodies[j].ToArgs()) as GamePlayComponent; rComps.Add(rComp); } GPCSkill rGPCSkill = new GPCSkill(this, rSymbolObjs[i].Head.ToArgs(), rComps); this.Skills.Add(rGPCSkill); } for (int i = 0; i < this.Skills.Count; i++) { this.Skills[i].Initialize(); } }
public object DeserializeFrom(Type type, byte[] bytes) { var rObj = HotfixReflectAssists.Construct(type) as HotfixSerializerBinary; using (var ms = new MemoryStream(bytes)) { using (var br = new BinaryReader(ms)) { rObj.Deserialize(br); } } return(rObj); }
public T DeserializeFrom <T>(byte[] bytes, int index, int count) where T : HotfixSerializerBinary { var rObj = HotfixReflectAssists.Construct(typeof(T)) as T; using (var ms = new MemoryStream(bytes, index, count)) { using (var br = new BinaryReader(ms)) { rObj.Deserialize(br); } } return(rObj as T); }
/// <summary> /// 初始化View controller /// </summary> protected virtual void InitializeViewController() { this.mViewController = HotfixReflectAssists.Construct(Type.GetType(this.ViewMB.HotfixName)) as ViewController; if (this.mViewController == null) { Debug.LogErrorFormat("Create View controller <color=blue>{0}</color> failed..", this.ViewMB.HotfixName); } else { this.mViewController.SetHotfix(this.ViewMB.HotfixName, this.GUID); this.mViewController.Initialize(this.ViewMB.Objects); } }