private void SetPanelMaterialTexture(WaveEngine.Common.Graphics.Texture texture) { Material panelMaterial = null; var materialComponent = this.Owner.FindComponent <MaterialComponent>(); if (materialComponent != null) { panelMaterial = materialComponent.Material; } else { // TODO: Remove MaterialsMap support, as it's deprecated. var materialsMap = this.Owner.FindComponent <MaterialsMap>(); if (materialsMap != null) { panelMaterial = materialsMap.DefaultMaterial; } } if (panelMaterial is Materials.StandardMaterial) { (panelMaterial as Materials.StandardMaterial).Diffuse1 = texture; } else if (panelMaterial is Materials.ForwardMaterial) { (panelMaterial as Materials.ForwardMaterial).Diffuse = texture; } }
/// <summary> /// Register a texture with a given identifier /// </summary> /// <param name="identifier">The texture identifier</param> /// <param name="texture">The texture</param> /// <returns>Whether the texture was registered (because it was not previously registered)</returns> public bool RegisterTexture(string identifier, WaveEngine.Common.Graphics.Texture texture) { return(this.textureProvider.RegisterTexture(identifier, texture)); }