2023-03-04 02:46:56 +08:00
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[NonSerialized]
|
|
|
|
|
TweenThread thread;
|
|
|
|
|
|
|
|
|
|
protected override void awake()
|
|
|
|
|
{
|
|
|
|
|
base.awake();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void start()
|
|
|
|
|
{
|
|
|
|
|
base.start();
|
|
|
|
|
|
|
|
|
|
Transform transform = GetComponent<Transform>();
|
|
|
|
|
if(transform != null)
|
|
|
|
|
{
|
2023-03-20 16:47:34 +08:00
|
|
|
|
thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.LINEAR);
|
|
|
|
|
thread.SetResetOnInactive(GameObject);
|
2023-03-04 02:46:56 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void update()
|
|
|
|
|
{
|
|
|
|
|
base.update();
|
|
|
|
|
|
|
|
|
|
Transform transform = GetComponent<Transform>();
|
|
|
|
|
|
|
|
|
|
if(thread != null && transform != null)
|
|
|
|
|
{
|
|
|
|
|
transform.LocalPosition = new Vector3( transform.LocalPosition.x ,thread.GetValue() , transform.LocalPosition.z);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|