10using System.Collections;
11using System.Collections.Generic;
17 [CustomEditor(typeof(WorkstationBehaviourExample))]
21 EditorGUI.BeginDisabledGroup(
target.workstationModeTween ==
null
22 ||
target.workstationModeTween.targetTransform ==
null
23 ||
target.workstationModeTween.startTransform ==
null
24 ||
target.workstationModeTween.endTransform ==
null
25 || Utils.IsObjectPartOfPrefabAsset(
target.gameObject));
27 EditorGUILayout.BeginHorizontal();
29 if (GUILayout.Button(
new GUIContent(
"Open Workstation",
30 "If the workstationModeTween is fully configured, you can "
31 +
"press this to set the target transform to the end (open) "
33 Undo.IncrementCurrentGroup();
34 Undo.SetCurrentGroupName(
"Open Workstation");
35 Undo.RecordObject(
target.workstationModeTween.targetTransform,
"Move Target To End");
36 target.workstationModeTween.SetTargetToEnd();
39 if (GUILayout.Button(
new GUIContent(
"Close Workstation",
40 "If the workstationModeTween is fully configured, you can "
41 +
"press this button to set the target transform to the start "
42 +
"(closed) state."))) {
43 Undo.IncrementCurrentGroup();
44 Undo.SetCurrentGroupName(
"Close Workstation");
45 Undo.RecordObject(
target.workstationModeTween.targetTransform,
"Move Target To Start");
46 target.workstationModeTween.SetTargetToStart();
49 EditorGUILayout.EndHorizontal();
51 EditorGUI.EndDisabledGroup();
53 base.OnInspectorGUI();
override void OnInspectorGUI()