UniversalViewer/Assets/Scripts/ModelViewerBase/UI/Handles/UIHandleMain.cs

26 lines
726 B
C#
Raw Normal View History

2024-04-21 22:38:26 +08:00
using UnityEngine;
public class UIHandleMain : UIHandle
{
public static UIHandleMain CreateAsChild(ObjectContainer owner)
{
var handle = CreateAsChild<UIHandleMain>(owner.transform);
handle.Init(owner).SetColor(Color.yellow).SetScale(1.5f);
return handle;
}
public override UIHandle Init(ObjectContainer owner)
{
base.Init(owner);
Popup.AddButton("Reset All", TransformResetAll);
Popup.AddButton("Reset Position", TransformResetPosition);
Popup.AddButton("Reset Rotation", TransformResetRotation);
Popup.AddButton("Reset Scale", TransformResetScale);
Popup.AddButton("Delete", () => Destroy(Owner));
return this;
}
}