示例#1
0
 public EntityVisual(AnimationSet animationSet)
 {
     direction         = 0;
     stance            = EntityStance.Standing;
     this.animationSet = animationSet;
     SetAnimation(stance, direction);
 }
示例#2
0
        private bool SetAnimation(EntityStance stance, int direction)
        {
            bool ok = SetAnimation(GetAnimationName(stance), direction);

            this.stance = GetEntityStance(AnimationName);
            return(ok);
        }
示例#3
0
        private string GetAnimationName(EntityStance stance)
        {
            switch (stance)
            {
            case EntityStance.Standing:
                return("stance");

            case EntityStance.Running:
                return("run");

            case EntityStance.Spawning:
                return("spawn");
            }
            return("");
        }
    public void InitializeDefaults()
    {
        isAlive    = true;
        isGrounded = true;

        health = 100;

        pace         = EntityPace.Jogging;
        stance       = EntityStance.Standing;
        action       = EntityAction.Idle;
        actionCached = EntityAction.Idle;

        aimSmoothing = true;
        aimTime      = 0.05f;

        rotationSmoothing = true;
        rotationTime      = 0.05f;

        speedSmoothing = false;
        speedTime      = 0.15f;

        velocitySmoothing = true;
        velocityTime      = 0.15f;
    }
示例#5
0
文件: Entity.cs 项目: Jebeli/Tiles
 public bool InitAnimation(EntityStance stance, int direction)
 {
     this.direction = direction;
     return(visual.Init(stance, direction));
 }
示例#6
0
 public bool Init(EntityStance stance, int direction)
 {
     this.stance    = stance;
     this.direction = direction;
     return(SetAnimation(stance, direction));
 }