summaryrefslogtreecommitdiff
path: root/VRCSDK3AvatarsQuestLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/Components/VRCPlayerStationEditor.cs
blob: 167c27968fb99fd42788a2024ff543c4750ade66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#if VRC_SDK_VRCSDK2

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using System;

[CustomEditor(typeof(VRCSDK2.VRC_Station))]
public class VRCPlayerStationEditor : Editor 
{
    VRCSDK2.VRC_Station myTarget;

	SerializedProperty onRemoteEnter;
	SerializedProperty onRemoteExit;
	SerializedProperty onLocalEnter;
	SerializedProperty onLocalExit;

	void OnEnable()
	{
		if(myTarget == null)
			myTarget = (VRCSDK2.VRC_Station)target;
		onRemoteEnter = serializedObject.FindProperty("OnRemotePlayerEnterStation");
		onRemoteExit = serializedObject.FindProperty("OnRemotePlayerExitStation");
		onLocalEnter = serializedObject.FindProperty("OnLocalPlayerEnterStation");
		onLocalExit = serializedObject.FindProperty("OnLocalPlayerExitStation");
	}

	public override void OnInspectorGUI()
	{
		myTarget.PlayerMobility = (VRC.SDKBase.VRCStation.Mobility)EditorGUILayout.EnumPopup("Player Mobility", myTarget.PlayerMobility);
		myTarget.canUseStationFromStation = EditorGUILayout.Toggle("Can Use Station From Station", myTarget.canUseStationFromStation);
		myTarget.animatorController = (RuntimeAnimatorController)EditorGUILayout.ObjectField("Animator Controller", myTarget.animatorController, typeof(RuntimeAnimatorController), false);
		myTarget.disableStationExit = EditorGUILayout.Toggle("Disable Station Exit", myTarget.disableStationExit);
		myTarget.seated = EditorGUILayout.Toggle("Seated", myTarget.seated);
		myTarget.stationEnterPlayerLocation = (Transform)EditorGUILayout.ObjectField("Player Enter Location", myTarget.stationEnterPlayerLocation, typeof(Transform), true);
		myTarget.stationExitPlayerLocation = (Transform)EditorGUILayout.ObjectField("Player Exit Location", myTarget.stationExitPlayerLocation, typeof(Transform), true);
		myTarget.controlsObject = (VRC.SDKBase.VRC_ObjectApi)EditorGUILayout.ObjectField("API Object", myTarget.controlsObject, typeof(VRC.SDKBase.VRC_ObjectApi), false);

		EditorGUILayout.PropertyField(onRemoteEnter, new GUIContent("On Remote Player Enter"));
		EditorGUILayout.PropertyField(onRemoteExit, new GUIContent("On Remote Player Exit"));
		EditorGUILayout.PropertyField(onLocalEnter, new GUIContent("On Local Player Enter"));
		EditorGUILayout.PropertyField(onLocalExit, new GUIContent("On Local Player Exit"));
	}
}
#endif