예제 #1
0
    public void Setup(EditBehavior behavior)
    {
        this.editBehavior = behavior;
        this.dieRenderer  = DiceRendererManager.Instance.CreateDiceRenderer(behavior.defaultPreviewSettings.design);
        if (dieRenderer != null)
        {
            behaviorRenderImage.texture = dieRenderer.renderTexture;
        }
        behaviorNameText.text = behavior.name;

        dieRenderer.SetAuto(true);
        dieRenderer.SetAnimations(this.editBehavior.CollectAnimations());
        dieRenderer.Play(true);
        RefreshState();
    }
예제 #2
0
    public void Setup(EditBehavior bh)
    {
        this.editBehavior = bh;
        this.dieRenderer  = DiceRendererManager.Instance.CreateDiceRenderer(bh.defaultPreviewSettings.design);
        if (dieRenderer != null)
        {
            behaviorRenderImage.texture = dieRenderer.renderTexture;
        }
        behaviorNameText.text        = bh.name;
        behaviorDescriptionText.text = bh.description;

        dieRenderer.SetAuto(true);
        dieRenderer.SetAnimations(this.editBehavior.CollectAnimations());
        dieRenderer.Play(true);
        Expand(false);
    }
예제 #3
0
    void Setup(EditBehavior behavior)
    {
        editBehavior     = behavior;
        this.dieRenderer = DiceRendererManager.Instance.CreateDiceRenderer(editBehavior.defaultPreviewSettings.design, 300);
        if (dieRenderer != null)
        {
            previewImage.texture = dieRenderer.renderTexture;
        }
        // Generate a title for the page
        descriptionText.text = editBehavior.description;

        RefreshView();

        dieRenderer.SetAuto(true);
        dieRenderer.SetAnimations(this.editBehavior.CollectAnimations());
        dieRenderer.Play(true);
    }
예제 #4
0
    void UpdateView()
    {
        if (this.dieRenderer != null)
        {
            DiceRendererManager.Instance.DestroyDiceRenderer(this.dieRenderer);
            this.dieRenderer = null;
        }

        var design = DesignAndColor.Unknown;
        var dName  = "Missing Die";

        if (editAssignment.die != null)
        {
            design = editAssignment.die.designAndColor;
            dName  = editAssignment.die.name;
        }

        var bName = "Missing Profile";

        if (editAssignment.behavior != null)
        {
            bName = editAssignment.behavior.name;
        }

        this.dieRenderer = DiceRendererManager.Instance.CreateDiceRenderer(design);
        if (dieRenderer != null)
        {
            diePreview.texture = dieRenderer.renderTexture;
        }
        dieRenderer.SetAuto(true);
        if (editAssignment.behavior != null)
        {
            dieRenderer.SetAnimations(editAssignment.behavior.CollectAnimations());
            dieRenderer.Play(true);
        }

        dieName.text      = dName;
        behaviorName.text = bName;
    }