Exemplo n.º 1
0
        protected virtual void Update()
        {
            if (paintableTexture != null && paintableTexture.Activated == true)
            {
                if (speed > 0.0f)
                {
                    counter += speed * Time.deltaTime;
                }

                if (counter >= threshold)
                {
                    var step = Mathf.FloorToInt(counter * 255.0f);

                    if (step > 0)
                    {
                        var change = step / 255.0f;

                        counter -= change;

                        P3dPaintFill.Command.Instance.SetState(false, 0);
                        P3dPaintFill.Command.Instance.SetMaterial(blendMode, texture, color, Mathf.Min(change, 1.0f), Mathf.Min(change, 1.0f));

                        P3dPaintableManager.Submit(P3dPaintFill.Command.Instance, null, paintableTexture);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void Paint(P3dCommandDecal command, MaterialProperty.PropertyType propertyType)
 {
     foreach (MaterialProperty materialProperty in materialProperties)
     {
         if (materialProperty.propertyType == propertyType)
         {
             command.ClearMask();
             command.ApplyAspect(materialProperty.paintableTexture.Current);
             P3dPaintableManager.Submit(command, p3dPaintable, materialProperty.paintableTexture);
         }
     }
 }
Exemplo n.º 3
0
        protected virtual void Update()
        {
            if (paintableTexture != null && paintableTexture.Activated == true)
            {
                if (speed > 0.0f)
                {
                    counter += speed * Time.deltaTime;
                }

                if (counter >= threshold)
                {
                    var step = Mathf.FloorToInt(counter * 255.0f);

                    if (step > 0)
                    {
                        var change = step / 255.0f;

                        counter -= change;

                        P3dCommandFill.Instance.SetState(false, 0);
                        P3dCommandFill.Instance.SetMaterial(blendMode, texture, color, Mathf.Min(change, 1.0f), Mathf.Min(change, 1.0f));

                        var command = P3dPaintableManager.Submit(P3dCommandFill.Instance, paintableTexture.Paintable, paintableTexture);

                        if (maskPaintableTexture != null)
                        {
                            command.LocalMaskTexture = maskPaintableTexture.Current;
                            command.LocalMaskChannel = P3dHelper.IndexToVector((int)maskChannel);
                        }
                        else if (maskTexture != null)
                        {
                            command.LocalMaskTexture = maskTexture;
                            command.LocalMaskChannel = P3dHelper.IndexToVector((int)maskChannel);
                        }
                    }
                }
            }
        }