Exemplo n.º 1
0
        public override void UpdateBinding(VisualEffect component)
        {
            if (component != null)
            {
                Texture t = FXDataProvider.GetMap(TextureToBind);
                if (t == null)
                {
                    return;
                }

                component.SetTexture(TextureProperty, t);

                if (BindSize)
                {
                    _Size = FXDataProvider.GetMapSize(TextureToBind);
                    if (_Size != null)
                    {
                        component.SetVector2(TextureSizeProperty, _Size);
                    }
                    else
                    {
                        component.SetVector2(TextureSizeProperty, Vector2.one);
                    }
                }

                if (BindScale)
                {
                    _Scale = FXDataProvider.GetMapScale(TextureToBind);
                    if (_Scale != null)
                    {
                        component.SetVector2(TextureScaleProperty, _Scale);
                    }
                    else
                    {
                        component.SetVector2(TextureScaleProperty, Vector2.one);
                    }
                }
            }
        }