49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using KitsuneCafe.System;
|
|
using R3;
|
|
using UnityEngine;
|
|
using UnityEngine.UIElements;
|
|
|
|
namespace KitsuneCafe.UI
|
|
{
|
|
[CreateAssetMenu(menuName = KitsuneCafeMenu.UiEffect + "Fade")]
|
|
public class TransitionEffect : BaseUIEffect
|
|
{
|
|
[SerializeField]
|
|
private string propertyName;
|
|
|
|
[SerializeField]
|
|
private SerializableDuration duration;
|
|
|
|
[SerializeField]
|
|
private EasingMode easing;
|
|
|
|
[SerializeField]
|
|
private SerializableDuration delay;
|
|
|
|
public override IUIEffect Instantiate()
|
|
{
|
|
return new TransitionEffectInstance(propertyName, duration, easing, delay);
|
|
}
|
|
}
|
|
|
|
public readonly struct TransitionEffectInstance : IUIEffect
|
|
{
|
|
public readonly StylePropertyName PropertyName;
|
|
public readonly TimeValue Duration;
|
|
public readonly EasingFunction Easing;
|
|
public readonly TimeValue Delay;
|
|
|
|
public TransitionEffectInstance(StylePropertyName name, TimeValue duration, EasingFunction easing, TimeValue delay)
|
|
{
|
|
PropertyName = name;
|
|
Duration = duration;
|
|
Easing = easing;
|
|
Delay = delay;
|
|
}
|
|
|
|
public Observable<R3.Unit> Execute(VisualElement target)
|
|
{
|
|
return Observable.Empty<R3.Unit>();
|
|
}
|
|
}
|
|
}
|