Exemplo n.º 1
0
    public void Add(TesView view)
    {
        GameObject obj = view.GameObject;

        if (obj != null && view.Shape != null)
        {
            Color32 colour = LookupColour(obj, obj.GetComponent <Collider>());
            view.Shape.Colour      = new Tes.Maths.Colour(colour.r, colour.g, colour.b, colour.a).Value;
            view.Shape.Transparent = colour.a < 255;
        }

        if (view.Dynamic)
        {
            _dynamicViews.Add(view);
        }
        else
        {
            _staticViews.Add(view);
        }

        if (_server != null && view.Shape != null)
        {
            _server.Create(view.Shape);
        }
    }
Exemplo n.º 2
0
    public void Remove(TesView view)
    {
        _staticViews.Remove(view);
        _dynamicViews.Remove(view);

        if (_server != null && view.Shape != null)
        {
            _server.Destroy(view.Shape);
        }
    }