-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCompositeTransition.cs
27 lines (23 loc) · 1.18 KB
/
CompositeTransition.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using JetBrains.Annotations;
using UnityEngine;
namespace UniMob.UI.Widgets
{
public class CompositeTransition : SingleChildLayoutWidget
{
public IAnimation<float> Opacity { get; set; } = new ConstAnimation<float>(1f);
public IAnimation<Vector2> Position { get; set; } = new ConstAnimation<Vector2>(Vector2.zero);
public IAnimation<Vector3> Scale { get; set; } = new ConstAnimation<Vector3>(Vector3.one);
public IAnimation<Quaternion> Rotation { get; set; } = new ConstAnimation<Quaternion>(Quaternion.identity);
public override State CreateState() => new CompositeTransitionState();
}
internal class CompositeTransitionState : SingleChildLayoutState<CompositeTransition>, ICompositeTransitionState
{
public override WidgetViewReference View { get; }
= WidgetViewReference.Resource("$$_CompositeTransition");
public IAnimation<float> Opacity => Widget.Opacity;
public IAnimation<Vector2> Position => Widget.Position;
public IAnimation<Vector3> Scale => Widget.Scale;
public IAnimation<Quaternion> Rotation => Widget.Rotation;
public Alignment Alignment => Alignment.Center;
}
}