Beispiel #1
0
    public void SetAnimationFrameByFloat(HumanAnimation ani, float progress, float step)
    {
        float percent = Mathf.Clamp01(RXMath.Mod(progress, step) / step);
        int   frame   = Mathf.RoundToInt(percent * (float)(ani.numFrames - 1));

        SetAnimationFrame(ani, frame);
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     _humanStuff  = GetComponent <HumanStuff>();
     _controller  = new MoveController(this);
     _seSystem    = new SolveEventSystem(this);
     _animSystem  = new HumanAnimation(this);
     _gameManager = GameManager.getInstance();
     Debug.Log(_gameManager);
 }
Beispiel #3
0
    public void SetAnimationFrame(HumanAnimation ani, int frame)
    {
        this.ani          = ani;
        this.currentFrame = frame % ani.numFrames;         //wrap it

        FAtlasElement newElement = ani.frames[currentFrame];

        if (bodySprite.element != newElement)
        {
            bodySprite.element = newElement;
            didAnimationChange = true;
        }
    }
Beispiel #4
0
    public void SetAnimationFrameByFloat(HumanAnimation ani, float progress, float step)
    {
        float percent = Mathf.Clamp01(RXMath.Mod(progress,step)/step);
        int frame = Mathf.RoundToInt(percent * (float)(ani.numFrames-1));

        SetAnimationFrame(ani,frame);
    }
Beispiel #5
0
    public void SetAnimationFrame(HumanAnimation ani, int frame)
    {
        this.ani = ani;
        this.currentFrame = frame % ani.numFrames; //wrap it

        FAtlasElement newElement = ani.frames[currentFrame];

        if(bodySprite.element != newElement)
        {
            bodySprite.element = newElement;
            didAnimationChange = true;
        }
    }
Beispiel #6
0
 public override void initComponents()
 {
     base.initComponents();
     mAnimation = addComponent <HumanAnimation>("HumanAnimation", true);
 }