Пример #1
0
    public void SetAnimationFrameByFloat(WolfAnimation ani, float progress, float step)
    {
        float percent = RXMath.Mod(progress, step) / step;
        int   frame   = Mathf.RoundToInt(percent * (float)(ani.numFrames - 1));

        SetAnimationFrame(ani, frame);
    }
Пример #2
0
    public void SetAnimationFrame(WolfAnimation 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;
        }
    }
Пример #3
0
    public void SetAnimationFrameByFloat(WolfAnimation ani, float progress, float step)
    {
        float percent = RXMath.Mod(progress,step)/step;
        int frame = Mathf.RoundToInt(percent * (float)(ani.numFrames-1));

        SetAnimationFrame(ani,frame);
    }
Пример #4
0
    public void SetAnimationFrame(WolfAnimation 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;
        }
    }
Пример #5
0
 void Start()
 {
     logic     = GetComponent <WolfMoveLogic>();
     animation = GetComponent <WolfAnimation>();
 }