Files
PrinceOfGlory/Assets/Scripts/Help/ShowCollectFontCtr.cs
kridoo 6e91a0c7f0 111
2025-09-15 17:32:08 +08:00

62 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using BigSpace.XRCore.RunningScene;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ShowCollectFontCtr : MonoBehaviour
{
public GameObject fontObj;
public List<Vector3> position = new List<Vector3>();
List<int> rotation = new List<int> { 90,180,180,270,0,0};
//计时相关
bool isRun = false;
float waitTime = 1f;
float runTime = 0;
// Start is called before the first frame update
void Start()
{
////关于等待出收集文字的
Debug.Log("当前场景编号:" + SceneMgr.Instance.nowSceneId);
if (SceneMgr.Instance.nowSceneId % 10000 <= 1)
{
fontObj.SetActive(false);
}
else
{
isRun = true;
}
}
private void Update()
{
if (isRun)
{
runTime += Time.deltaTime;
if (runTime >= waitTime)
{
isRun = false;
runTime = 0;
SetPosition();
}
}
}
void SetPosition()
{
int index = (SceneMgr.Instance.nowSceneId % 10000) - 2; //开始第0,1个场景不需要显示跳转到下一个场景才需要显示
fontObj.SetActive(true);
for (int i = 0; i < position.Count; i++)
{
if (index == i)
{
fontObj.transform.position = position[i];
fontObj.transform.localRotation = Quaternion.Euler(new Vector3(0, rotation[i], 0));
}
}
}
}