Skip to content

Commit

Permalink
Add stuck sprite fix and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf committed Aug 20, 2022
1 parent 6b488ed commit 0de0e97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Assets.Scripts.Core.Scene/LayerPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public void ReturnLayer(Layer layer)
{
layer.LayerID = null;
GameObject gameObject = layer.gameObject;

if (IsInPool(gameObject))
{
MOD.Scripts.Core.MODLogger.Log("WARNING: Ignoring layer returned twice", true);
return;
}

gameObject.transform.parent = base.transform;
gameObject.layer = LayerMask.NameToLayer("NotRendered");
gameObject.SetActive(value: false);
Expand Down
4 changes: 4 additions & 0 deletions Assets.Scripts.Core.Scene/SceneController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ public void FadeSprite(int layer, float wait, bool isblocking)
{
ifInUse.FadeOutLayer(wait, isblocking);
}
else
{
MOD.Scripts.Core.MODLogger.Log($"WARNING: FadeSprite Failed as layer not in use", true);
}
}

public void DrawSprite(int layer, string texture, string mask, int x, int y, int z, int originx, int originy, int angle, int style, float alpha, int priority, float wait, bool isblocking)
Expand Down

0 comments on commit 0de0e97

Please sign in to comment.