public Actor AddActor(int id, EActorType type, EBattleCamp camp, XTransform param, bool isMainPlayer = false) { Actor pActor = null; if (isMainPlayer) { pActor = new ActorMainPlayer(id, 100, EActorType.PLAYER, camp); pActor.Load(param); object[] args = new object[] { pActor.CacheTransform.transform }; CameraEffectBase effect = MainCamera.GetComponent <CameraFollow>(); effect.Init(0, MainCamera, null, args); } else { pActor = new ActorPlayer(id, 100, type, camp); pActor.Load(param); } if (pActor.CacheTransform != null) { Debug.LogError("添加人物" + pActor.ActorType); //pActor.CacheTransform.parent = GetHolder(EMapHolder.Role).transform; AllActors.Add(pActor); //LevelData.CampActors[camp].Add(pActor); } return(pActor); }
public override void Import(DCFG cfg) { LvlBorn data = cfg as LvlBorn; this.Camp = data.Camp; this.Pos = data.Pos; this.Euler = data.Euler; }
public Actor(int id, int guid, EActorType type, EBattleCamp camp, List <Vector3> PatrolGroups) : base(id, guid) { this.ActorType = type; this.Camp = camp; this.PatrolGroups = PatrolGroups; this.MonsterType = GameDataManage.Instance.GetDBEntiny(Id).MonsterType; }
public Character AddActor(int id, EBattleCamp camp, EActorType type, GTTransform bornData, XCharacter data, bool isMain = false) { Character cc = new Character(id, data == null ? GTGUID.NewGUID() : data.GUID, type, camp, isMain); bornData.Pos = GTTools.NavSamplePosition(bornData.Pos); cc.Load(bornData); cc.SyncData(data, ESyncDataType.TYPE_ALL); SetCharacterParent(cc); Characters.Add(cc); return(cc); }
public override void Import(LoadXML pData, bool pBuild) { MapBorn data = pData as MapBorn; Camp = data.Camp; Position = data.TransParam.Position; Scale = data.TransParam.Scale; Euler = data.TransParam.EulerAngles; this.Build(); this.SetName(); }
public override void DrawGUI() { #if UNITY_EDITOR m_CurCamp = (EBattleCamp)UnityEditor.EditorGUILayout.EnumPopup("Camp", Camp); if (m_CurCamp != Camp) { this.Camp = m_CurCamp; this.DrawScene(); this.SetName(); } #endif }
public override void Read(XmlNode os) { foreach (XmlNode current in LoadXML.GetChilds(os)) { switch (current.Name) { case "Camp": this.Camp = (EBattleCamp)ReadInt(current); break; case "TransParam": this.TransParam = new MapTransform(); this.TransParam.Read(current); break; } } }
public Actor AddActor(int id, EActorType type, EBattleCamp camp, XTransform param, List <Vector3> PatrolGroups, bool isMainPlayer = false) { int guid = GetGUID(); Actor pActor = null; switch (type) { case EActorType.PLAYER: { if (isMainPlayer) { pActor = new ActorMainPlayer(id, guid, EActorType.PLAYER, camp, null); } else { pActor = new ActorPlayer(id, guid, EActorType.PLAYER, camp, null); } } break; case EActorType.MONSTER: pActor = new Actor(id, guid, type, camp, PatrolGroups); break; } if (pActor != null) { param.Position = GTTools.NavSamplePosition(param.Position); pActor.Load(param); if (pActor.CacheTransform != null) { pActor.CacheTransform.parent = GetHolder(EMapHolder.Role).transform; LevelData.AllActors.Add(pActor); LevelData.CampActors[camp].Add(pActor); } } return(pActor); }
public ActorMainPlayer(int id, int guid, EActorType type, EBattleCamp camp) : base(id, guid, type, camp) { }
public ActorMainPlayer(int id, int guid, EActorType type, EBattleCamp camp, List <Vector3> PatrolGroups) : base(id, guid, type, camp, PatrolGroups) { }
public Actor AddActor(int id, EActorType type, EBattleCamp camp, Vector3 pos, Vector3 angle, Vector3 scale, List <Vector3> PatrolGroups) { return(AddActor(id, type, camp, XTransform.Create(pos, angle, scale), PatrolGroups)); }
public Actor(int id, int guid, EActorType type, EBattleCamp camp) : base(id, guid) { this.ActorType = type; this.Camp = camp; //this.MonsterType = ZTConfig.Instance.GetDBEntiny(Id).MonsterType; }
public Character AddActorNoneSync(int id, EBattleCamp camp, EActorType type, KTransform bornData) { return(AddActor(id, camp, type, bornData, null, false)); }
public override void Read(XmlElement os) { this.Camp = os.GetEnum <EBattleCamp>("Camp"); this.Pos = os.GetVector3("Pos"); this.Euler = os.GetVector3("Euler"); }