First commit for private source control. Older commits available on Github.
This commit is contained in:
25
Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs
Normal file
25
Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
#if PRIME_TWEEN_INSTALLED
|
||||
using PrimeTween;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PrimeTweenDemo {
|
||||
public class Headlights : Animatable {
|
||||
[SerializeField] AnimationCurve ease;
|
||||
[SerializeField] Light[] lights;
|
||||
bool isOn;
|
||||
|
||||
public override void OnClick() {
|
||||
Animate(!isOn);
|
||||
}
|
||||
|
||||
public override Sequence Animate(bool _isOn) {
|
||||
isOn = _isOn;
|
||||
var sequence = Sequence.Create();
|
||||
foreach (var _light in lights) {
|
||||
sequence.Group(Tween.LightIntensity(_light, _isOn ? 0.7f : 0, 0.8f, ease));
|
||||
}
|
||||
return sequence;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user