public void slideOut(float time) { this.animTime = time; this.animStartTime = Time.time; this.animType = AnimTypes.OUT; this.destPosition = this.outPosition; }
public void slideIn(float time) { this.gameObject.SetActive(true); this.animTime = time; this.animStartTime = Time.time; this.rt.localPosition = this.inPosition; this.animType = AnimTypes.OUT; this.destPosition = this.startPosition; }
private void CarryAnim(AnimTypes type, Player player) { switch (type) { case AnimTypes.twoHanded_front: player.animManager.ChangeToCarry_Front(transform); break; case AnimTypes.twoHanded_weapon: player.animManager.ChangeToCarry_TwoHanded_Weapon(transform); break; } }
void Update() { if (this.animType != AnimTypes.STOP) { var progressPercent = (Time.time - this.animStartTime) / this.animTime; this.rt.localPosition = Vector3.Lerp(this.rt.localPosition, this.destPosition, progressPercent); if (progressPercent >= 1.0f) { if (this.animType == AnimTypes.OUT) { this.gameObject.SetActive(true); } this.animType = AnimTypes.STOP; } } }
public SimpleAnimation(Sprite spriteToChange, AnimTypes animType, params AnimationFrame[] frames) { SpriteToChange = spriteToChange; AnimType = animType; AnimFrames = frames; }