SharedVRCStuff/AAC/AACCore/Runtime/AACRoot.cs
Lillith Rose 1d7052a258 Bring in AAC!
project ive been working on for a while, just felt confident enough to move it here
2025-12-09 21:40:28 -05:00

50 lines
No EOL
1.9 KiB
C#

using UnityEditor;
using UnityEngine;
using VRC.SDKBase;
namespace gay.lilyy.aaccore {
/// <summary>
/// Adding this to the avatar root will build the FX layer.
/// </summary>
public class AACRoot : MonoBehaviour, IEditorOnly {
public bool experimentalPlayMode = true;
public bool experimentalUpload = false;
// unity needs this to show the enable/disable box
void Start(){}
#if UNITY_EDITOR
[CustomEditor(typeof(AACRoot))]
private class Editor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
// Draw the default message
EditorGUILayout.HelpBox(
"Adding this to the avatar root will build the FX layer.",
MessageType.Info
);
// Draw the 'Enable Experimental Layers' toggle
var component = (AACRoot)target;
EditorGUI.BeginChangeCheck();
bool newValPlay = EditorGUILayout.Toggle("Enable Experimental Layers in Play Mode", component.experimentalPlayMode);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(component, "Toggle Experimental Layers in Play Mode");
component.experimentalPlayMode = newValPlay;
EditorUtility.SetDirty(component);
}
EditorGUI.BeginChangeCheck();
bool newValUpload = EditorGUILayout.Toggle("Enable Experimental Layers in Uploads", component.experimentalUpload);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(component, "Toggle Experimental Layers in Uploads");
component.experimentalPlayMode = newValUpload;
EditorUtility.SetDirty(component);
}
}
}
#endif
}
}