public DynamicBodyUnitEntity(Team team, DynamicBody body, float angle, RootEntity root) : base(team, body, angle, root) { AnimationComponent animation = new AnimationComponent(root); GetComponent <BodyComponent>().SetAnimationComponent(animation); AddComponent(animation); }
public PlayerData GetPlayerData() { BodyComponent body = GetComponent <BodyComponent>(); AnimationComponent animation = GetComponent <AnimationComponent>(); return(new PlayerData() { EntityID = EntityID, PeerID = PeerID, Team = (byte)Team, PosX = body.Position.X, PosZ = body.Position.Y, Angle = body.Angle, Warped = body.Warped, Anime = (ushort)animation.Anime, Loop = animation.Loop, }); }
public void SetAnimationComponent(AnimationComponent animation) { this.animation = animation; }