Пример #1
0
        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);
        }
Пример #2
0
        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;
 }