Esempio n. 1
0
        protected override void OnTCEnable()
        {
            m_tabGroup = GetOpenClose();

            foreach (var system in Targets)
            {
                if (m_drawers.ContainsKey(system))
                {
                    continue;
                }

                var emitter = system.Emitter;

                if (emitter != null)
                {
                    m_drawers[system] = new TCWireframeDrawer(emitter.EmitMesh);
                }
            }
        }
        public static void DrawEmitterShape(ParticleEmitterShape pes, Transform transform, TCWireframeDrawer drawer)
        {
            var col = new Color(0.6f, 0.9f, 1.0f);

            Handles.color = col;

            switch (pes.shape)
            {
            case EmitShapes.Sphere:
                pes.radius.Max = RadiusHandle(transform, pes.radius.Max, true);

                if (!pes.radius.IsConstant)
                {
                    Handles.color = new Color(0.6f, 0.9f, 1.0f, 0.4f);

                    if (pes.radius.Min > 0.0f)
                    {
                        pes.radius.Min = RadiusHandle(transform, pes.radius.Min, true);
                    }
                    Handles.color = col;
                }
                break;


            case EmitShapes.Box:
                pes.cubeSize = CubeHandle(transform, pes.cubeSize);
                break;

            case EmitShapes.HemiSphere:
                pes.radius.Value = HemisphereHandle(transform, pes.radius.Max, true);

                if (!pes.radius.IsConstant)
                {
                    if (pes.radius.Min > 0.0f)
                    {
                        pes.radius.Min = HemisphereHandle(transform, pes.radius.Min, true);
                    }
                }

                break;

            case EmitShapes.Cone:

                float coneAngle  = pes.coneAngle;
                float coneHeight = pes.coneHeight;
                float coneRadius = pes.coneRadius;


                ConeHandle(ref coneAngle, ref coneHeight, ref coneRadius, transform);

                pes.coneAngle  = coneAngle;
                pes.coneHeight = coneHeight;
                pes.coneRadius = coneRadius;

                break;

            case EmitShapes.Ring:

                float ringRadius = pes.ringRadius;
                float ringOuter  = pes.ringOuterRadius;

                TorusHandle(ref ringRadius, ref ringOuter, transform);

                pes.ringRadius      = ringRadius;
                pes.ringOuterRadius = ringOuter;
                break;

            case EmitShapes.Line:
                pes.lineLength = LineHandle(pes.lineLength, transform);
                break;

            case EmitShapes.Mesh:
                if (pes.emitMesh == null)
                {
                    break;
                }

                drawer.DrawWireMesh(transform);
                break;
            }
        }
Esempio n. 3
0
 protected override void OnTCEnable()
 {
     m_target = target as TCShapeEmitter;
     m_drawer = new TCWireframeDrawer(m_target.ShapeData.emitMesh);
 }