50 lines
1.1 KiB
C#
50 lines
1.1 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;
|
|||
|
|
|||
|
|
|||
|
[NonSerialized]
|
|||
|
TweenThread thread;
|
|||
|
|
|||
|
protected override void awake()
|
|||
|
{
|
|||
|
base.awake();
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
protected override void start()
|
|||
|
{
|
|||
|
base.start();
|
|||
|
|
|||
|
Transform transform = GetComponent<Transform>();
|
|||
|
if(transform != null)
|
|||
|
{
|
|||
|
thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.EASE_IN_SINE);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|