-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* halfway through adjusting tablet ui
- Loading branch information
Showing
33 changed files
with
5,683 additions
and
1,499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using UnityEngine; | ||
|
||
namespace ScriptableBake { | ||
|
||
/// <summary> | ||
/// Changes the transform parent. | ||
/// </summary> | ||
[AddComponentMenu("ScriptableBake/Change Parent"), DisallowMultipleComponent] | ||
public sealed class ChangeParent : MonoBehaviour, IBaked { | ||
|
||
public const int Order = FlattenHierarchy.Order - 10; | ||
|
||
public Transform NewParent; | ||
|
||
#region IBaked | ||
|
||
#if UNITY_EDITOR | ||
|
||
int IBaked.Order { | ||
get { return Order; } | ||
} | ||
|
||
bool IBaked.Bake(BakeFlags flags, BakeContext context) { | ||
transform.SetParent(NewParent); | ||
Baking.Destroy(this); | ||
return true; | ||
} | ||
|
||
#endif // UNITY_EDITOR | ||
|
||
#endregion // IBaked | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/FieldDay/Plugins/ScriptableBake/ChangeParent.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using BeauRoutine; | ||
using FieldDay.Animation; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace FieldDay.UI.Animation { | ||
public sealed class PopAnim : LiteAnimator<LayoutOffset> { | ||
|
||
private readonly Vector2 m_Offset; | ||
private readonly float m_Duration; | ||
private readonly Curve m_Ease; | ||
|
||
public PopAnim(Vector2 offset, float duration, Curve ease = Curve.Linear) { | ||
m_Offset = offset; | ||
m_Duration = duration; | ||
m_Ease = ease; | ||
} | ||
|
||
static private void PrepareState(ref LiteAnimatorState state, Vector2 offsetAmt, float duration, float delay, Curve easing) { | ||
state.Duration = duration; | ||
state.TimeRemaining = duration + delay; | ||
state.InitParamA.Float2 = offsetAmt; | ||
state.Easing = easing; | ||
} | ||
|
||
public override void InitAnimation(LayoutOffset target, ref LiteAnimatorState state) { | ||
if (state.TimeRemaining <= state.Duration) { | ||
target.Offset1 = state.InitParamA.Float2; | ||
} | ||
} | ||
|
||
public override void ResetAnimation(LayoutOffset target, ref LiteAnimatorState state) { | ||
target.Offset1 = default; | ||
} | ||
|
||
public override bool UpdateAnimation(LayoutOffset target, ref LiteAnimatorState state, float deltaTime) { | ||
state.TimeRemaining -= deltaTime; | ||
float percent = state.Easing.Evaluate(1 - Math.Max(0, state.TimeRemaining / state.Duration)); | ||
if (percent >= 0) { | ||
target.Offset1 = state.InitParamA.Float2 * (1f - percent); | ||
} | ||
return state.TimeRemaining > 0; | ||
} | ||
|
||
static public readonly PopAnim Default = new PopAnim(new Vector2(0, -4), 8 / 60f, Curve.Linear); | ||
static public readonly PopAnim DefaultUp = new PopAnim(new Vector2(0, 4), 8 / 60f, Curve.Linear); | ||
|
||
static public AnimHandle Play(LayoutOffset offset, PopAnim config, float delay = 0, GameLoopPhase phase = GameLoopPhase.Update) { | ||
LiteAnimatorState animState = new LiteAnimatorState(); | ||
PrepareState(ref animState, config.m_Offset, config.m_Duration, delay, config.m_Ease); | ||
return Game.Animation.AddLiteAnimator(config, offset, animState, phase); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.