public void SetTexture(string name, string sprite)
    {
        int property = IndexProperty(name, false);

        if (string.IsNullOrEmpty(sprite))
        {
            throw new CYFException("shader.SetTexture: The second argument, the texture, needs to be the name of an image in your Sprites folder.");
        }

        Sprite spr = SpriteRegistry.Get(sprite);

        if (spr == null)
        {
            throw new CYFException("The sprite Sprites/" + sprite + ".png doesn't exist.");
        }
        material.SetTexture(property, spr.texture);
    }