How to set Mipmap filtermode with code

Hi friends

I came here because I have a question.

I’m using FilterMode to modify some textures in the game I’m developing. I’m midifying the image by setting FilterMode: Bilinear with mipmaps, Wrap Mode: Clamp in the editor,

How can I reflect this effect in code? I’m currently using the following code, but the effect is different from what I set in the editor.

spriteFrame.texture.setMipFilter(2);
spriteFrame.texture.setFilters(
Texture2D.Filter.LINEAR,
Texture2D.Filter.LINEAR
);
spriteFrame.texture.setWrapMode(
Texture2D.WrapMode.CLAMP_TO_EDGE,
Texture2D.WrapMode.CLAMP_TO_EDGE
);

Can you tell me what the problem is and how to fix it?

Thank you guys

You can try to use spriteFrame._refreshTexture to refresh texture, and calculateUV();

Thanks for the reply. Could you please tell me how to differentiate between billionaire and trillionaire in code?