Files
defrain-shooter-unity/Assets/Scripts/DebugCanvas.cs
Noah4ever 14a8f084d3 PostProcessing & Universal RP
added PostProcessing and Universal Render Pipeline from the Packet Manager.
You can disable PostProcessing (If it lags too much) by disabling PostProcessingVolume in the Hierarchy.

added some fancy lights to the test scnee
added dirt texture to the camera
added bloom to the lights
added light to explosion from grenade
2021-12-10 09:22:32 +01:00

48 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using Mirror;
public class DebugCanvas : MonoBehaviour
{
public TextMeshProUGUI DebugTextGrounded;
public TextMeshProUGUI DebugTextClientServer;
public GameObject Player;
public GameObject GameManager;
public TextMeshProUGUI fpsText;
public float deltaTime;
private void Start()
{
GameManager = GameObject.Find("GameManager");
}
private void Update()
{
if(Player == null)
{
try
{
Player = GameObject.FindGameObjectWithTag("Player").gameObject;
Debug.Log("Player Found");
}
catch
{
//Debug.Log("DEBUG CANVAS PLAYER NOT YET FOUND");
}
}
else
{
DebugTextGrounded.text = "isGrounded: " + Player.GetComponent<PlayerController>().isGrounded.ToString();
deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
float fps = 1.0f / deltaTime;
fpsText.text = Mathf.Ceil(fps).ToString() + "FPS";
}
}
}