UniversalViewer/Assets/KF3/Scripts/Handles/UIHandleCerulean.cs

31 lines
1.1 KiB
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UIHandleCerulean : UIHandle
{
protected KF3CeruleanContainer mContainer => Owner as KF3CeruleanContainer;
public static UIHandleCerulean CreateAsChild(KF3ObjectContainer owner)
{
var handle = CreateAsChild<UIHandleCerulean>(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 Position", () => TransformResetPosition());
Popup.AddButton("Reset Rotation", () => TransformResetRotation());
Popup.AddButton("Reset Scale", () => TransformResetScale());
Popup.AddButton("Toggle Physics", () => mContainer.TogglePhysics());
Popup.AddButton("Toggle Bones", () => mContainer.ToggleBonesVisible(!mContainer.BonesVisible));
Popup.AddButton("Reset Bones", () => mContainer.ResetBones());
Popup.AddButton("Delete", () => Destroy(Owner));
return this;
}
}