Beispiel #1
0
        public bool Inspect()
        {
            var changed = false;


            pegi.FullWindowService.DocumentationClickOpen(() => "Will cast a ray in transform.forward direction when Left Mouse Button is pressed. " +
                                                          "Target objects need to have PlaytimePainter component attached. Then this brush will be applied " +
                                                          "on texture (if not locked) selected on target PlaytimePainter component" +
                                                          "This Component has it's own brush configuration. Can be replaced with PainterCamera.Data.brushConfig " +
                                                          "to use global brush.", "How to use Skinned Mesh Caster", 15);


            if ("Paint!".Click().nl())
            {
                Paint();
            }

            "Last ray Cast result: {0}".F(lastShotResult).nl();

            brush.Targets_PEGI().nl(ref changed);
            brush.Mode_Type_PEGI().nl(ref changed);
            brush.ColorSliders().nl(ref changed);


            return(changed);
        }
Beispiel #2
0
        public bool Inspect()
        {
            var changed = false;

            pegi.FullWindow.DocumentationClickOpen(() => "When colliding with other object will try to use sphere brush to paint on them." +
                                                   "Targets need to have PlaytimePainter component", "About Painter Ball");


            if (Application.isPlaying)
            {
                "Painting on {0} objects".F(paintingOn.Count).nl();
            }

            if (_collider.isTrigger && "Set as Rigid Collider object".Click().nl(ref changed))
            {
                _collider.isTrigger = false;
                rigid.isKinematic   = false;
                rigid.useGravity    = true;
            }

            if (!_collider.isTrigger && "Set as Trigger".Click().nl(ref changed))
            {
                _collider.isTrigger = true;
                rigid.isKinematic   = true;
                rigid.useGravity    = false;
            }

            var size = transform.localScale.x;

            if ("Size:".edit("Size of the ball", 50, ref size, 0.1f, 10).nl(ref changed))
            {
                transform.localScale = Vector3.one * size;
            }

            const string ballHint = "PaintBall_brushHint";

            "Painter ball made for World Space Brushes only".writeOneTimeHint(ballHint);

            if ((brush.Targets_PEGI().nl(ref changed)) || (brush.Mode_Type_PEGI().nl(ref changed)))
            {
                if (brush.targetIsTex2D || !brush.Is3DBrush())
                {
                    brush.targetIsTex2D = false;
                    brush.SetBrushType(false, BrushTypes.Sphere.Inst);

                    pegi.resetOneTimeHint(ballHint);
                }
            }

            if (brush.ColorSliders())
            {
                rendy.sharedMaterial.color = brush.Color;
            }

            return(false);
        }
Beispiel #3
0
        public bool Inspect()
        {
            var changed = false;

            pegi.toggleDefaultInspector(this);

            pegi.fullWindowDocumentationClickOpen(Documentation);

            "Continious".toggleIcon(ref continious).nl();

            if (!continious)
            {
                "Bullets:".edit(50, ref shoots, 1, 50).nl(ref changed);
                "Spread:".edit(50, ref spread, 0f, 1f).nl(ref changed);
            }

            if ("Fire!".Click().nl())
            {
                Paint();
            }

            brush.Targets_PEGI().nl(ref changed);
            brush.Mode_Type_PEGI().nl(ref changed);
            brush.ColorSliders().nl(ref changed);

            if (brush.targetIsTex2D)
            {
                "Script expects Render Texture terget".writeWarning();
                pegi.nl();

                if ("Switch to Render Texture".Click())
                {
                    brush.targetIsTex2D = false;
                }
            }
            else if (brush.GetBrushType(false).GetType() != typeof(BrushTypes.Sphere))
            {
                "This component works best with Sphere Brush? also supports Normal Brush.".writeHint();
                //if ("Switch to Sphere Brush".Click())
                //  brush.SetBrushType(false, BrushTypes.Sphere.Inst);
            }


            if (!brush.PaintingRGB)
            {
                "Enable RGB, disable A to use faster Brush Shader (if painting to RenderTexture).".writeHint();
            }

            return(changed);
        }
        public bool Inspect()
        {
            var changed = false;

            pegi.FullWindowService.DocumentationClickOpen(() => "During collision will try to cast ray in the direction of that collision. " +
                                                          "If target has Playtime Painter Component this script will try to paint on it.", "How to use Raycast On Collision");

            if (Application.isPlaying)
            {
                "Painting on {0} objects".F(_paintingOn.Count).nl();
            }

            brush.Targets_PEGI().nl(ref changed);
            brush.Mode_Type_PEGI().nl(ref changed);
            brush.ColorSliders().nl(ref changed);

            return(changed);
        }