internal StandardTextureHiddenSelection(MaterialBase.TextureData data, String name, Boolean scaleOffset)
        {
            this.name             = name;
            this.data             = data;
            this.showSelection    = false;
            this.startTexture     = this.data.texture;
            this.textureSelection = new ScrollableEnumSelection <Texture2DIndex>(Texture2DIndex.None, "Texture", (texInd) =>
            {
                Texture tex = null;
                if (texInd == Texture2DIndex.None)
                {
                    tex = this.startTexture;
                }
                else
                {
                    tex = AssetsCore.LoadAsset <Texture2D>(texInd);
                }
                this.data.texture = tex;
            });

            if (scaleOffset && data is MaterialBase.ScaleOffsetTextureData)
            {
                var soData    = data as MaterialBase.ScaleOffsetTextureData;
                var curScale  = soData.tiling;
                var curOffset = soData.offset;
                this.tilingEntry = new NamedVector2TextEntry(curScale, "Tiling", (vec) => soData.tiling = vec);
                this.offsetEntry = new NamedVector2TextEntry(curOffset, "Offset", (vec) => soData.offset = vec);
            }
        }
Пример #2
0
 internal TextEntry(Vector2 inValue, String name, Action <Vector2> onChanged)
 {
     this.elem = new NamedVector2TextEntry(inValue, name, onChanged);
 }