TG9six 03a642d635 first push
first push
2025-09-06 17:17:39 +04:00

37 lines
1019 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DebugData : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
line1 = gameObject.transform.Find("Line1").GetComponent<Text>();
line2 = gameObject.transform.Find("Line2").GetComponent<Text>();
line3 = gameObject.transform.Find("Line3").GetComponent<Text>();
line4 = gameObject.transform.Find("Line4").GetComponent<Text>();
}
// Update is called once per frame
void Update()
{
if (Time.time - lastUpdateTime < 1.0f)
return;
lastUpdateTime = Time.time;
line1.text = "FPS: " + (1.0f / Time.deltaTime).ToString("0");
line2.text = "POSITION: " + Player.Instance.transform.position;
line3.text = "";
line4.text = "";
}
private Text line1;
private Text line2;
private Text line3;
private Text line4;
float lastUpdateTime = 0.0f;
}