Added Panel in Live View and IK mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leo Qu
2026-02-22 19:45:48 -05:00
parent 3a19a03e7c
commit 8c313fbdb3
6 changed files with 1547 additions and 339 deletions

33
Assets/IKModulePanel.cs Normal file
View File

@@ -0,0 +1,33 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
/// <summary>
/// IK-mode side panel: shows fixed-module hint. Text is set in the scene.
/// </summary>
public class IKModulePanel : MonoBehaviour
{
public TextMeshProUGUI moduleInfoText;
[Header("Panel Layout")]
public float panelWidth = 260f;
[Range(0f, 0.5f)]
public float cornerRadius = 0.12f;
void Start()
{
ApplyRoundedMaterial();
}
void ApplyRoundedMaterial()
{
var img = GetComponent<Image>();
if (img == null || (img.material != null && img.material.shader != null && img.material.shader.name == "UI/RoundedRect")) return;
var shader = Shader.Find("UI/RoundedRect");
if (shader == null) return;
var mat = new Material(shader);
mat.SetFloat("_Radius", cornerRadius);
img.material = mat;
}
}