Space-Smash-Out/Assets/Plugins/PrimeTween/Demo/Scripts/JumpAnimation.cs
Jakob Feldmann 64162cb4a1 feat: whole project restructuring
This can be seen as the initial state of the project after the released demo.

The changes include:
- New ship models
- Singleton manager structure to keep project scaleable in the future
     - Managing players, their settings, character choices, statistics, match setups, controls etc. in a separate decoupled scene
- Main menu with transitions to the arena scene
- Beginnings of a custom audio solution
- Logging with Log4Net

It is really a complete overhaul of the projects structure and management.
2024-04-01 23:06:39 +02:00

21 lines
756 B
C#

#if PRIME_TWEEN_INSTALLED
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public class JumpAnimation : MonoBehaviour {
[SerializeField] Transform target;
Sequence sequence;
public void PlayAnimation() {
if (!sequence.isAlive) {
const float jumpDuration = 0.3f;
sequence = Tween.Scale(target, new Vector3(1.1f, 0.8f, 1.1f), 0.15f, Ease.OutQuad, 2, CycleMode.Yoyo)
.Chain(Tween.LocalPositionY(target, 1, jumpDuration))
.Chain(Tween.LocalEulerAngles(target, Vector3.zero, new Vector3(0, 360), 1.5f, Ease.InOutBack))
.Chain(Tween.LocalPositionY(target, 0, jumpDuration));
}
}
}
}
#endif