コード例 #1
0
        private void ShowRaycastFields()
        {
            UndoableInputFieldUtils.LayerField(() => _controller.TargetCollisionLayer, v => _controller.TargetCollisionLayer = v, "Raycast Layer", _controller);
            UndoableInputFieldUtils.EnumField(() => _controller.RaycastType, v => _controller.RaycastType = (LeiaAutoFocus.RaycastTypes)v, "Raycast Type", _controller);

            if (_controller.RaycastType == LeiaAutoFocus.RaycastTypes.Sphere)
            {
                EditorGUI.indentLevel = 2;
                ShowSphereRadius();
                EditorGUI.indentLevel = 1;
            }
        }
コード例 #2
0
        private void ShowTrackingTypes()
        {
            UndoableInputFieldUtils.EnumField(() => _controller.TrackingMode, v => _controller.TrackingMode = (LeiaAutoFocus.TrackingModes)v, "Tracking Mode", _controller);

            if (_controller.TrackingMode == LeiaAutoFocus.TrackingModes.Target)
            {
                EditorGUI.indentLevel = 1;
                _controller.Target    = (GameObject)EditorGUILayout.ObjectField("Target", _controller.Target, typeof(GameObject), true);
                ShowLookAtTarget();
                EditorGUI.indentLevel = 0;
            }
            else if (_controller.TrackingMode == LeiaAutoFocus.TrackingModes.Raycast)
            {
                EditorGUI.indentLevel = 1;
                ShowRaycastFields();
                ShowMaxFocusDistance();
                EditorGUI.indentLevel = 0;
            }
        }