コード例 #1
0
 public static Transform RemoveController(UnitySensor sensor)
 {
     if (sensor.sensorTransform != null)
     {
         DestroyImmediate(sensor.sensorTransform.gameObject, true);
     }
     return(null);
 }
コード例 #2
0
        public static bool ControllerInspector(UnitySensor controller)
        {
            EditorGUILayout.BeginHorizontal();

            controller.enabled = EditorGUILayout.ToggleLeft(controller.name, controller.enabled, GUILayout.MinWidth(80));
            if (controller.enabled && Application.isPlaying)
            {
                EditorGUILayout.EnumPopup(controller.status);
            }

            EditorGUILayout.EndHorizontal();
            return(controller.enabled);
        }
コード例 #3
0
        public static bool ControllerInspector(UnitySensor controller, Target target)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            bool enabled = EditorGUILayout.ToggleLeft(controller.name, controller.enabled, GUILayout.MinWidth(80));

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, enabled ? "Enabled " : "Disabled " + controller.name);
                controller.enabled = enabled;
            }
            if (Application.isPlaying && enabled)
            {
                EditorGUILayout.EnumPopup(controller.status);
            }
            EditorGUILayout.EndHorizontal();
            return(enabled);
        }