Ejemplo n.º 1
0
        protected virtual void OnSceneGUI()
        {
            var targ = this.target as VisualAspect;

            if (targ == null)
            {
                return;
            }
            if (!targ.enabled)
            {
                return;
            }

            VisualAspectInspector.Material.SetColor("_colorSolid", Color.black);
            VisualAspectInspector.Material.SetFloat("_colorAlpha", 0.4f);

            Matrix4x4 mat = Matrix4x4.TRS(targ.transform.position, Quaternion.identity, Vector3.one * 0.1f);

            for (int i = 0; i < VisualAspectInspector.Material.passCount; ++i)
            {
                VisualAspectInspector.Material.SetPass(i);
                Graphics.DrawMeshNow(PrimitiveUtil.GetMesh(PrimitiveType.Sphere), mat);
            }

            VisualAspectInspector.Material.SetColor("_colorSolid", targ.AspectColor);
            VisualAspectInspector.Material.SetFloat("_colorAlpha", 0.8f);

            mat = Matrix4x4.TRS(targ.transform.position, Quaternion.identity, Vector3.one * 0.08f);

            for (int i = 0; i < VisualAspectInspector.Material.passCount; ++i)
            {
                VisualAspectInspector.Material.SetPass(i);
                Graphics.DrawMeshNow(PrimitiveUtil.GetMesh(PrimitiveType.Sphere), mat);
            }
        }
Ejemplo n.º 2
0
        private static void DrawIcon(VisualAspect targ)
        {
            SensorRenderUtil.AspectMaterial.SetColor("_colorSolid", Color.black);
            SensorRenderUtil.AspectMaterial.SetFloat("_colorAlpha", 0.4f);

            Matrix4x4 mat = Matrix4x4.TRS(targ.transform.position, Quaternion.identity, Vector3.one * 0.1f);

            for (int i = 0; i < SensorRenderUtil.AspectMaterial.passCount; ++i)
            {
                SensorRenderUtil.AspectMaterial.SetPass(i);
                Graphics.DrawMeshNow(PrimitiveUtil.GetMesh(PrimitiveType.Sphere), mat);
            }

            SensorRenderUtil.AspectMaterial.SetColor("_colorSolid", targ.AspectColor);
            SensorRenderUtil.AspectMaterial.SetFloat("_colorAlpha", 0.8f);

            mat = Matrix4x4.TRS(targ.transform.position, Quaternion.identity, Vector3.one * 0.08f);

            for (int i = 0; i < SensorRenderUtil.AspectMaterial.passCount; ++i)
            {
                SensorRenderUtil.AspectMaterial.SetPass(i);
                Graphics.DrawMeshNow(PrimitiveUtil.GetMesh(PrimitiveType.Sphere), mat);
            }
        }