Esempio n. 1
0
    public void ReplaceLineView(UnityEngine.UI.Extensions.UILineRenderer newLine1, UnityEngine.UI.Extensions.UILineRenderer newLine2)
    {
        var index     = GameComponentsLookup.LineView;
        var component = (LineViewComponent)CreateComponent(index, typeof(LineViewComponent));

        component.Line1 = newLine1;
        component.Line2 = newLine2;
        ReplaceComponent(index, component);
    }
Esempio n. 2
0
    public GameEntity SetLineView(UnityEngine.UI.Extensions.UILineRenderer newLine1, UnityEngine.UI.Extensions.UILineRenderer newLine2)
    {
        if (hasLineView)
        {
            throw new Entitas.EntitasException("Could not set LineView!\n" + this + " already has an entity with LineViewComponent!",
                                               "You should check if the context already has a lineViewEntity before setting it or use context.ReplaceLineView().");
        }
        var entity = CreateEntity();

        entity.AddLineView(newLine1, newLine2);
        return(entity);
    }
Esempio n. 3
0
    public void ReplaceLineView(UnityEngine.UI.Extensions.UILineRenderer newLine1, UnityEngine.UI.Extensions.UILineRenderer newLine2)
    {
        var entity = lineViewEntity;

        if (entity == null)
        {
            entity = SetLineView(newLine1, newLine2);
        }
        else
        {
            entity.ReplaceLineView(newLine1, newLine2);
        }
    }