void Repaint(EditPattern currentPattern)
 {
     Object.Destroy(_texture);
     if (greyscale)
     {
         _texture = currentPattern.ToGreyscaleTexture();
     }
     else
     {
         _texture = currentPattern.ToTexture();
     }
     patternImage.texture = _texture;
 }
Exemple #2
0
    void RepaintPreview()
    {
        Object.Destroy(_texture);

        var anim = new EditAnimationKeyframed();

        anim.name     = "temp anim";
        anim.pattern  = currentPattern;
        anim.duration = currentPattern.duration;

        dieRenderer.SetAuto(true);
        dieRenderer.SetAnimation(anim);
        dieRenderer.Play(true);

        _texture = currentPattern.ToTexture();
        patternPreview.texture = _texture;
    }
Exemple #3
0
    public void Setup(EditPattern pattern)
    {
        this.editPattern = pattern;
        this.dieRenderer = DiceRendererManager.Instance.CreateDiceRenderer(Dice.DesignAndColor.V5_Black);
        if (dieRenderer != null)
        {
            animRenderImage.texture = dieRenderer.renderTexture;
        }
        animNameText.text = pattern.name;

        var anim = new EditAnimationKeyframed();

        anim.name     = "temp anim";
        anim.pattern  = pattern;
        anim.duration = pattern.duration;

        textureImage.texture = pattern.ToTexture();

        dieRenderer.SetAuto(true);
        dieRenderer.SetAnimation(anim);
        dieRenderer.Play(true);
    }
    public void Setup(EditPattern pattern)
    {
        this.editPattern = pattern;
        this.dieRenderer = DiceRendererManager.Instance.CreateDiceRenderer(Dice.DesignAndColor.V5_Black);
        if (dieRenderer != null)
        {
            animRenderImage.texture = dieRenderer.renderTexture;
        }
        patternNameText.text = pattern.name;

        var anim = new EditAnimationKeyframed();

        anim.name     = "temp anim";
        anim.pattern  = pattern;
        anim.duration = pattern.duration;
        sizeText.text = "Size: " + (pattern.gradients.Sum(g => g.keyframes.Count) * 2).ToString() + " bytes";

        textureImage.texture = pattern.ToTexture();

        dieRenderer.SetAuto(true);
        dieRenderer.SetAnimation(anim);
        dieRenderer.Play(true);
        Expand(false);
    }