Esempio n. 1
0
        internal void ApplyToGodotTexture(Godot.Texture texture)
        {
            var flags = texture.Flags;

            if (Filter)
            {
                flags |= (int)Godot.Texture.FlagsEnum.Filter;
            }
            else
            {
                flags &= ~(int)Godot.Texture.FlagsEnum.Filter;
            }

            switch (WrapMode)
            {
            case TextureWrapMode.None:
                flags &= ~(int)Godot.Texture.FlagsEnum.Repeat;
                flags &= ~(int)Godot.Texture.FlagsEnum.MirroredRepeat;
                break;

            case TextureWrapMode.Repeat:
                flags |= (int)Godot.Texture.FlagsEnum.Repeat;
                flags &= ~(int)Godot.Texture.FlagsEnum.MirroredRepeat;
                break;

            case TextureWrapMode.MirroredRepeat:
                flags &= ~(int)Godot.Texture.FlagsEnum.Repeat;
                flags |= (int)Godot.Texture.FlagsEnum.MirroredRepeat;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            texture.Flags = flags;
        }
Esempio n. 2
0
 public GodotTextureSource(Godot.Texture texture)
 {
     GodotTexture = texture;
 }
Esempio n. 3
0
 public GodotTextureSource(Godot.Texture texture)
 {
     DebugTools.Assert(GameController.OnGodot);
     GodotTexture = texture;
 }
Esempio n. 4
0
 /// <inheritdoc />
 public virtual bool UsesTexture(IMixedRealityExtensionApp app, Material material, Texture texture)
 {
     return(material.AlbedoTexture == texture);
 }