界面调整
This commit is contained in:
1 parent
a96d538dc1
commit
922f66bb75
14 files changed
+6087
-4079
No files matched your search
@@ -0,0 +1,40 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class ArrowSpirteRenderScript:MonoBehaviour
|
||||
{
|
||||
List<Sprite> sprites;
|
||||
Image image;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
sprites = new List<Sprite>();
|
||||
for (int i = 1; i < 51; i++)
|
||||
{
|
||||
sprites.Add(Resources.Load<Sprite>($"Images/Ride/Ride Bright/Ride_bright{i.ToString("0000")}"));
|
||||
}
|
||||
image = transform.GetComponent<Image>();
|
||||
}
|
||||
int index = 0;
|
||||
float time = 0;
|
||||
void Update()
|
||||
{
|
||||
time += Time.deltaTime;
|
||||
if (time < 0.03)
|
||||
{
|
||||
return;
|
||||
}
|
||||
time = 0;
|
||||
if (index % 49 == 0)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
image.sprite = sprites[index];
|
||||
index ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user