animation for locomotions, block
This commit is contained in:
37
Assets/Scripts/Utils/RotationDebugger.cs
Normal file
37
Assets/Scripts/Utils/RotationDebugger.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using UnityEngine;
|
||||
using Invector.vCharacterController; // Required to get access to the controller
|
||||
|
||||
public class RotationDebugger : MonoBehaviour
|
||||
{
|
||||
private vThirdPersonController cc;
|
||||
private GUIStyle style;
|
||||
|
||||
void Start()
|
||||
{
|
||||
cc = GetComponent<vThirdPersonController>();
|
||||
|
||||
// Setup for on-screen display
|
||||
style = new GUIStyle();
|
||||
style.fontSize = 18;
|
||||
style.fontStyle = FontStyle.Bold;
|
||||
style.normal.textColor = Color.white;
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
if (cc == null) return;
|
||||
|
||||
// Create a semi-transparent background box
|
||||
GUI.Box(new Rect(10, 10, 350, 140), "");
|
||||
|
||||
// Display critical information on screen
|
||||
string debugText = "--- ROTATION DEBUG ---";
|
||||
debugText += $"\nRotation: {transform.rotation.eulerAngles.ToString("F2")}";
|
||||
debugText += $"\nIs Rolling: {(cc.isRolling ? "<color=green>True</color>" : "<color=red>False</color>")}";
|
||||
debugText += $"\nLock Rotation: {(cc.lockRotation ? "<color=red>True</color>" : "<color=green>False</color>")}";
|
||||
debugText += $"\nAnimator Root Motion: {(cc.animator.applyRootMotion ? "<color=green>True</color>" : "<color=red>False</color>")}";
|
||||
|
||||
style.richText = true;
|
||||
GUI.Label(new Rect(15, 15, 340, 130), debugText, style);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Utils/RotationDebugger.cs.meta
Normal file
2
Assets/Scripts/Utils/RotationDebugger.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a069af71c57a846598551f9d5bf36cef
|
||||
Reference in New Issue
Block a user