avatar/Assets/VRCSDK/SDK3A/Editor/Components3/VRCAvatarDescriptorEditor3View.cs
2022-09-27 20:47:45 -07:00

44 lines
1.2 KiB
C#

#if VRC_SDK_VRCSDK3
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using VRC.SDK3.Avatars.Components;
public partial class AvatarDescriptorEditor3 : Editor
{
void DrawView()
{
if (Foldout("VRCSDK3_AvatarDescriptorEditor3_ViewFoldout", "View"))
{
var viewPosition = serializedObject.FindProperty("ViewPosition");
EditorGUILayout.BeginHorizontal();
{
EditorGUILayout.PropertyField(viewPosition);
bool isActive = IsActiveProperty(viewPosition);
if(isActive)
GUI.backgroundColor = _activeButtonColor;
if (GUILayout.Button(isActive ? "Return" : "Edit", EditorStyles.miniButton, GUILayout.MaxWidth(PreviewButtonWidth)))
{
if (isActive)
SetActiveProperty(null);
else
SetActiveProperty(viewPosition);
_repaint = true;
}
GUI.backgroundColor = Color.white;
}
EditorGUILayout.EndHorizontal();
Separator();
}
}
}
#endif