Added TweenThreadVec3. Updated UI elements to use new textures and fonts. Gameplay UI WIP #380

Merged
maverickdgg merged 6 commits from SP3-20-UI-System into main 2023-03-02 12:46:12 +08:00
1 changed files with 54 additions and 0 deletions
Showing only changes of commit 4f1ecf1b50 - Show all commits

View File

@ -0,0 +1,54 @@
using SHADE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SHADE_Scripting.UI
{
public class MultiplierTextFx : Script
{
[NonSerialized]
private TweenThread sizeThread;
private TweenThread alphaThread;
public float maxSize = 1.0f;
public float minSize = 0.3f;
public float minAlpha = 0.3f;
[NonSerialized]
private Vector3 defaultScale;
protected override void start()
{
sizeThread = TweenManager.CreateTweenThread(GameManager.Instance.maxMultiplierDuration, maxSize, minSize, EASING_METHOD.EASE_IN_SINE);
alphaThread = TweenManager.CreateTweenThread(GameManager.Instance.maxMultiplierDuration, 1.0f, minAlpha, EASING_METHOD.EASE_OUT_SINE);
Transform transform = GetComponent<Transform>();
if (transform != null)
defaultScale = transform.LocalScale;
}
protected override void update()
{
Transform transform = GetComponent<Transform>();
if(transform != null)
{
if(sizeThread.IsCompleted())
{
transform.LocalScale = Vector3.Zero;
}
else
{
transform.LocalScale = defaultScale * sizeThread.GetValue();
}
}
}
}
}