UnityEditor.Handles.ConeFrustrumHandle C# (CSharp) Method

ConeFrustrumHandle() static private method

static private ConeFrustrumHandle ( Quaternion rotation, Vector3 position, Vector3 radiusAngleRange ) : Vector3
rotation UnityEngine.Quaternion
position Vector3
radiusAngleRange Vector3
return Vector3
        internal static Vector3 ConeFrustrumHandle(Quaternion rotation, Vector3 position, Vector3 radiusAngleRange)
        {
            return DoConeFrustrumHandle(rotation, position, radiusAngleRange);
        }

Usage Example

Exemplo n.º 1
0
        public override void OnSceneGUI(ParticleSystem s, InitialModuleUI initial)
        {
            Color color = Handles.color;

            Handles.color = ShapeModuleUI.s_ShapeGizmoColor;
            Matrix4x4 matrix   = Handles.matrix;
            Matrix4x4 matrix4x = default(Matrix4x4);

            matrix4x.SetTRS(s.transform.position, s.transform.rotation, s.transform.lossyScale);
            Handles.matrix = matrix4x;
            EditorGUI.BeginChangeCheck();
            int intValue = this.m_Type.intValue;

            if (intValue == 0 || intValue == 1)
            {
                this.m_Radius.floatValue = Handles.DoSimpleRadiusHandle(Quaternion.identity, Vector3.zero, this.m_Radius.floatValue, false);
            }
            if (intValue == 10 || intValue == 11)
            {
                float floatValue  = this.m_Radius.floatValue;
                float floatValue2 = this.m_Arc.floatValue;
                Handles.DoSimpleRadiusArcHandleXY(Quaternion.identity, Vector3.zero, ref floatValue, ref floatValue2);
                this.m_Radius.floatValue = floatValue;
                this.m_Arc.floatValue    = floatValue2;
            }
            else if (intValue == 2 || intValue == 3)
            {
                this.m_Radius.floatValue = Handles.DoSimpleRadiusHandle(Quaternion.identity, Vector3.zero, this.m_Radius.floatValue, true);
            }
            else if (intValue == 4 || intValue == 7)
            {
                Vector3 radiusAngleRange = new Vector3(this.m_Radius.floatValue, this.m_Angle.floatValue, initial.m_Speed.scalar.floatValue);
                radiusAngleRange                  = Handles.ConeFrustrumHandle(Quaternion.identity, Vector3.zero, radiusAngleRange);
                this.m_Radius.floatValue          = radiusAngleRange.x;
                this.m_Angle.floatValue           = radiusAngleRange.y;
                initial.m_Speed.scalar.floatValue = radiusAngleRange.z;
            }
            else if (intValue == 8 || intValue == 9)
            {
                Vector3 radiusAngleRange2 = new Vector3(this.m_Radius.floatValue, this.m_Angle.floatValue, this.m_Length.floatValue);
                radiusAngleRange2        = Handles.ConeFrustrumHandle(Quaternion.identity, Vector3.zero, radiusAngleRange2);
                this.m_Radius.floatValue = radiusAngleRange2.x;
                this.m_Angle.floatValue  = radiusAngleRange2.y;
                this.m_Length.floatValue = radiusAngleRange2.z;
            }
            else if (intValue == 5)
            {
                Vector3 zero   = Vector3.zero;
                Vector3 vector = new Vector3(this.m_BoxX.floatValue, this.m_BoxY.floatValue, this.m_BoxZ.floatValue);
                if (this.m_BoxEditor.OnSceneGUI(matrix4x, ShapeModuleUI.s_ShapeGizmoColor, false, ref zero, ref vector))
                {
                    this.m_BoxX.floatValue = vector.x;
                    this.m_BoxY.floatValue = vector.y;
                    this.m_BoxZ.floatValue = vector.z;
                }
            }
            else if (intValue == 12)
            {
                this.m_Radius.floatValue = Handles.DoSimpleEdgeHandle(Quaternion.identity, Vector3.zero, this.m_Radius.floatValue);
            }
            else if (intValue == 6)
            {
                Mesh mesh = (Mesh)this.m_Mesh.objectReferenceValue;
                if (mesh)
                {
                    bool wireframe = GL.wireframe;
                    GL.wireframe = true;
                    this.m_Material.SetPass(0);
                    Graphics.DrawMeshNow(mesh, s.transform.localToWorldMatrix);
                    GL.wireframe = wireframe;
                }
            }
            if (EditorGUI.EndChangeCheck())
            {
                this.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner.Repaint();
            }
            Handles.color  = color;
            Handles.matrix = matrix;
        }
All Usage Examples Of UnityEditor.Handles::ConeFrustrumHandle