UnityEditor.Handles.ConeHandle C# (CSharp) Method

ConeHandle() static private method

static private ConeHandle ( Quaternion rotation, Vector3 position, Vector2 angleAndRange, float angleScale, float rangeScale, bool handlesOnly ) : Vector2
rotation UnityEngine.Quaternion
position Vector3
angleAndRange Vector2
angleScale float
rangeScale float
handlesOnly bool
return Vector2
        internal static Vector2 ConeHandle(Quaternion rotation, Vector3 position, Vector2 angleAndRange, float angleScale, float rangeScale, bool handlesOnly)
        {
            return DoConeHandle(rotation, position, angleAndRange, angleScale, rangeScale, handlesOnly);
        }

Usage Example

Exemplo n.º 1
0
        private void OnSceneGUI()
        {
            Light light = (Light)this.target;
            Color color = Handles.color;

            if (light.enabled)
            {
                Handles.color = LightEditor.kGizmoLight;
            }
            else
            {
                Handles.color = LightEditor.kGizmoDisabledLight;
            }
            float num = light.range;

            switch (light.type)
            {
            case LightType.Spot:
            {
                Color color2 = Handles.color;
                color2.a      = Mathf.Clamp01(color.a * 2f);
                Handles.color = color2;
                Vector2 angleAndRange = new Vector2(light.spotAngle, light.range);
                angleAndRange = Handles.ConeHandle(light.transform.rotation, light.transform.position, angleAndRange, 1f, 1f, true);
                if (GUI.changed)
                {
                    Undo.RecordObject(light, "Adjust Spot Light");
                    light.spotAngle = angleAndRange.x;
                    light.range     = Mathf.Max(angleAndRange.y, 0.01f);
                }
                break;
            }

            case LightType.Point:
                num = Handles.RadiusHandle(Quaternion.identity, light.transform.position, num, true);
                if (GUI.changed)
                {
                    Undo.RecordObject(light, "Adjust Point Light");
                    light.range = num;
                }
                break;

            case LightType.Area:
            {
                EditorGUI.BeginChangeCheck();
                Vector2 areaSize = Handles.DoRectHandles(light.transform.rotation, light.transform.position, light.areaSize);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(light, "Adjust Area Light");
                    light.areaSize = areaSize;
                }
                break;
            }
            }
            Handles.color = color;
        }
All Usage Examples Of UnityEditor.Handles::ConeHandle