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