コード例 #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
ファイル: Wolf.cs プロジェクト: BoarK/BewareWolf
    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
ファイル: Wolf.cs プロジェクト: BoarK/BewareWolf
    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>();
 }