Skip to content

Commit

Permalink
Scenecontrol: Fix wrapmode not serializing/deserializing
Browse files Browse the repository at this point in the history
  • Loading branch information
0thElement committed Aug 19, 2024
1 parent 8a0e65f commit c4365ec
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Assets/Scripts/Gameplay/Scenecontrol/Controllers/Scene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public ImageController CreateImage(
},
cts.Token).ContinueWith(sprite => c.Image.sprite = sprite));

c.SerializedType = $"image.{imgPath},{material},{renderLayer},{pivotVec.x},{pivotVec.y}";
c.SerializedType = $"image.{imgPath},{material},{renderLayer},{pivotVec.x},{pivotVec.y},{wrapMode}";
c.Start();
Services.Scenecontrol.AddReferencedController(c);
return c;
Expand Down Expand Up @@ -449,7 +449,7 @@ public SpriteController CreateSprite(
},
cts.Token).ContinueWith(sprite => c.SpriteRenderer.sprite = sprite));

c.SerializedType = $"sprite.{imgPath},{material},{renderLayer},{pivotVec.x},{pivotVec.y}";
c.SerializedType = $"sprite.{imgPath},{material},{renderLayer},{pivotVec.x},{pivotVec.y},{wrapMode}";
c.Start();
Services.Scenecontrol.AddReferencedController(c);
return c;
Expand Down Expand Up @@ -736,13 +736,15 @@ private Controller GetBaseControlerFromTypeName(string def, string arg)
return track.ExtraR;
case "image":
string[] imgsplit = arg.Split(',');
return CreateImage(imgsplit[0], imgsplit[1], imgsplit[2], new XY(float.Parse(imgsplit[3]), float.Parse(imgsplit[4])));
string imgWrapMode = imgsplit.Length <= 5 ? "repeat" : imgsplit[5];
return CreateImage(imgsplit[0], imgsplit[1], imgsplit[2], new XY(float.Parse(imgsplit[3]), float.Parse(imgsplit[4])), imgWrapMode);
case "canvas":
bool worldSpace = arg.ToLower() == "true";
return CreateCanvas(worldSpace);
case "sprite":
string[] spriteSplit = arg.Split(',');
return CreateSprite(spriteSplit[0], spriteSplit[1], spriteSplit[2], new XY(float.Parse(spriteSplit[3]), float.Parse(spriteSplit[4])));
string sprWrapMode = spriteSplit.Length <= 5 ? "repeat" : spriteSplit[5];
return CreateSprite(spriteSplit[0], spriteSplit[1], spriteSplit[2], new XY(float.Parse(spriteSplit[3]), float.Parse(spriteSplit[4])), sprWrapMode);
case "text":
string[] textSplit = arg.Split(',');
return CreateText(
Expand Down

0 comments on commit c4365ec

Please sign in to comment.