mb fixed CharacterController; FpsCount

This commit is contained in:
DerTyp187
2021-10-13 08:50:54 +02:00
parent 475110316b
commit 5e15b47d35
4 changed files with 28 additions and 23 deletions

View File

@@ -7,9 +7,15 @@ public class DebugCanvas : MonoBehaviour
{
public TextMeshProUGUI DebugTextGrounded;
public GameObject Player;
public TextMeshProUGUI fpsText;
public float deltaTime;
private void Update()
{
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";
}
}