コード例 #1
0
ファイル: VFXSphereGizmos.cs プロジェクト: vault51/Graphics
        public override void OnDrawSpacedGizmo(TArcSphere arcSphere)
        {
            float radius = arcSphere.sphere.radius;
            float arc    = arcSphere.arc * Mathf.Rad2Deg;

            using (new Handles.DrawingScope(Handles.matrix * arcSphere.sphere.transform))
            {
                // Draw semi-circles at 90 degree angles
                for (int i = 0; i < 4; i++)
                {
                    float currentArc = (float)(i * 90);
                    if (currentArc <= arc)
                    {
                        Handles.DrawWireArc(Vector3.zero, Matrix4x4.Rotate(Quaternion.Euler(0.0f, 180.0f, currentArc)) * Vector3.right, Vector3.forward, 180.0f, radius);
                    }
                }

                // Draw an extra semi-circle at the arc angle
                if (arcSphere.arc < Mathf.PI * 2.0f)
                {
                    Handles.DrawWireArc(Vector3.zero, Matrix4x4.Rotate(Quaternion.Euler(0.0f, 180.0f, arc)) * Vector3.right, Vector3.forward, 180.0f, radius);
                }

                // Draw 3rd circle around the arc
                Handles.DrawWireArc(Vector3.zero, -Vector3.forward, Vector3.up, arc, radius);

                ArcGizmo(Vector3.zero, radius, arc, m_ArcProperty, Quaternion.Euler(-90.0f, 0.0f, 0.0f));
            }

            VFXTSphereGizmo.DrawSphere(this, arcSphere.sphere, m_CenterProperty, m_AnglesProperty, m_ScaleProperty, m_RadiusProperty);
        }
コード例 #2
0
ファイル: VFXSphereGizmos.cs プロジェクト: vault51/Graphics
        public override Bounds OnGetSpacedGizmoBounds(Sphere value)
        {
            var tSphere = (TSphere)value;

            return(VFXTSphereGizmo.GetBoundsFromSphere(tSphere));
        }
コード例 #3
0
ファイル: VFXSphereGizmos.cs プロジェクト: vault51/Graphics
        public override void OnDrawSpacedGizmo(Sphere sphere)
        {
            var tSphere = (TSphere)sphere;

            VFXTSphereGizmo.DrawSpaceSphere(this, tSphere, m_CenterProperty, null, null, m_RadiusProperty);
        }
コード例 #4
0
ファイル: VFXSphereGizmos.cs プロジェクト: vault51/Graphics
 public override Bounds OnGetSpacedGizmoBounds(TArcSphere value)
 {
     return(VFXTSphereGizmo.GetBoundsFromSphere(value.sphere));
 }