Ejemplo n.º 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);
    }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
        }
    }
Ejemplo n.º 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);
    }
Ejemplo n.º 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;
        }
    }
Ejemplo n.º 6
0
 public override void initComponents()
 {
     base.initComponents();
     mAnimation = addComponent <HumanAnimation>("HumanAnimation", true);
 }