- Home /
Question by
maltakereuz · Nov 01, 2018 at 10:11 AM ·
texture2drepeatwrapmode
Setting texture wrap mode from script
I want to set Texture2D wrap mode to Repeat from script. Unfortunately this does not seem to work.
fillTexture.wrapMode = TextureWrapMode.Repeat;
fillTexture.Apply();
EditorUtility.SetDirty(fillTexture);
AssetDatabase.SaveAssets();
Texture will be for a short time in Repeat mode indeed, but then after reloading scene it will be shown in Clamp. It is in clamp mode in Editor.
What am i doing wrong? At first i tried only the first line of this code, but it does not work too.
Comment
Changes while in play mode aren't(always) saved once going back into editor mode. Look into play mode to editor mode persistence.
Your answer
Follow this Question
Related Questions
Texture sampling - clamping to a border color 0 Answers
Cannot create 2D object with repeating texture 0 Answers
Texture repeat not working! 4 Answers
Vertical or Horizontal texture wrapmode 1 Answer
Animations in booleans loop? 1 Answer