SHADE_Y3/Assets/Scripts/UI/SC_ScrollingCredits.cs

50 lines
1.0 KiB
C#

using System;
using SHADE;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SHADE_Scripting.UI
{
public class ScrollingCredits : Script
{
public float endY = 4000.0f;
public float duration = 30.0f;
public GameObject levelTransition;
[NonSerialized]
TweenThread thread;
protected override void awake()
{
base.awake();
}
protected override void start()
{
Transform transform = GetComponent<Transform>();
if (transform != null)
{
thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.LINEAR);
thread.SetResetOnInactive(GameObject);
}
}
protected override void update()
{
Transform transform = GetComponent<Transform>();
if (thread != null && transform != null)
{
transform.LocalPosition = new Vector3(transform.LocalPosition.x, thread.GetValue(), transform.LocalPosition.z);
}
}
}
}