Search Unity

SpriteManager - draw lots of sprites in a single draw call!

Discussion in 'iOS and tvOS' started by Brady, Jan 15, 2009.

  1. twomack33

    twomack33

    Joined:
    May 14, 2009
    Posts:
    10
    I have been playing with the Sprite manager and I have managed to get a sprite to be added to an existing empty gameobject. It shows correctly and I am using the same view settings as the demo.
    Problem is that when I rotate the gameobject that the sprite is attached to, the sprite does not rotate.
    The GameObject does but not the sprite.

    Any ideas?
     
  2. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    If you are using the SpriteManager class, you'll have to call UpdatePositions() when you want it to update the positions of the meshes. But if your game is constantly changing the positions of your sprites, it's a lot easier just to use the LinkedSpriteManager class instead which will always automatically update the sprite positions each frame.
     
  3. twomack33

    twomack33

    Joined:
    May 14, 2009
    Posts:
    10
    For my empty Gameobject at 0,0,0 I am using the LinkedSpriteManager.
    Anything else to look for?
     
  4. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Hmmm... not that comes readily to mind. I'll ponder it and let you know if I think of anything else. In the meantime, try comparing everything in your test against the way the demo is setup.
     
  5. twomack33

    twomack33

    Joined:
    May 14, 2009
    Posts:
    10
    Right now I have the following:
    1)An Empty gameObject at 0,0,0 with the LinkedSprite Manager Class
    2)Another empty object at 0,0,0 with a script that is a whittled down version of the demo script.
    It takes the Spritemanager and a gameojbect as inputs.
    Then it creates a sprite attached to that gameobject.
    3)Another empty gameObject I am using to attach the sprite to. This object then has a very simple rotation script.

    As said earlier the sprite shows.And the gameobject the sprite is attached to rotates, But the sprite does not rotate.
    I have included the project in this post.
    Thanks for any and all help!
     

    Attached Files:

  6. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Ahh, I see the problem. You have billboarding set to true. Billboarded sprites can't rotate. If you set that to false, it should work just fine.

    Billboarding is primarily used just in situations where the camera can move around the scene in 3D and you want the sprite to always face toward the camera no matter where the camera is. For a 2D game, or a game where the camera will always look at the scene from one direction (even if it can move side-to-side or up-and-down), you shouldn't need billboarding.
     
  7. twomack33

    twomack33

    Joined:
    May 14, 2009
    Posts:
    10
    That was it! Thank you very much.
    Thanks for this great asset!
     
  8. AHansenGD

    AHansenGD

    Joined:
    May 4, 2009
    Posts:
    11
    I decided to try out the new version and test out the animation functionality in order to replace my (hopefully) slower code that I am currently using. The problem seems to be when I call PlayAnim on the sprite the sprite doesn't animate. It instead shows the bottom left 64 X 64 pixel area of my sprite sheet. Any Ideas?

    Code (csharp):
    1. public class CTestScript : MonoBehaviour
    2. {
    3.     public LinkedSpriteManager m_SpriteManager;
    4.     string animation1Name;
    5.     string animation2Name;
    6.     Sprite testSprite;
    7.     GameObject spriteObject;
    8.     // Use this for initialization
    9.     void Start ()
    10.     {
    11.         UVAnimation animation1 = new UVAnimation();
    12.         //BuildUVAnim(Vector2 start, Vector2 cellSize, int cols, int rows, int totalCells, float fps)
    13.         animation1.BuildUVAnim(new Vector2(0,511), new Vector2(64,64), 5, 1, 5, 5);
    14.         animation1.name = animation1Name = "Attack North";
    15.         animation1.loopCycles = -1;
    16.  
    17.         UVAnimation animation2 = new UVAnimation();
    18.         //BuildUVAnim(Vector2 start, Vector2 cellSize, int cols, int rows, int totalCells, float fps)
    19.         animation2.BuildUVAnim(new Vector2(320,511), new Vector2(64,64), 5, 1, 5, 5);
    20.         animation2.name = animation2Name = "Attack NE";
    21.         animation2.loopCycles = -1;
    22.        
    23.         spriteObject = new GameObject();
    24.         testSprite = m_SpriteManager.AddSprite(spriteObject, 1, 1, 0, 511, 64, 64, true);
    25.        
    26.         testSprite.AddAnimation(animation1);
    27.         testSprite.AddAnimation(animation2);
    28.     }
    29.    
    30.     // Update is called once per frame
    31.     void Update ()
    32.     {
    33.         if(Input.GetMouseButtonDown(0))
    34.             testSprite.PlayAnim(animation1Name);
    35.         if(Input.GetMouseButtonDown(1))
    36.             testSprite.PlayAnim(animation2Name);
    37.     }
    38. }
     
  9. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    The thing that stands out to me here is that it looks like you are passing un-converted pixel coordinates. You need to use sprite.PixelCoordToUVCoord() for the lower-left pixel and sprite.PixelSpaceToUVSpace() for the dimensions.

    Try that and see if it fixes it.

    By the way, I've got SpriteManager 2 coming out as licensed middleware you may want to check out. It should make everyone's lives a whole ton easier. Here are just a few of its new features:

    • * Setup your sprite and animations all in-editor using the inspector. No more coding required!

      * Drag-and-drop animation building.

      * Automatic sprite atlas generation.

      * Automatic pixel-perfect sprite sizing.

      * Support for non-uniform animation frames without distortion using the new auto-resizing feature!
    I'll soon be accepting limited discounted orders for those who want to start using the current release candidate. Watch this space for developments:
    www.AnBSoft.com/middleware
     
  10. AHansenGD

    AHansenGD

    Joined:
    May 4, 2009
    Posts:
    11
    Thanks for the help, I hadn't looked thoroughly through the new code. I made the assumption it worked like AddSprite where the conversion occurs in the function. I can't wait to get SpriteManager2 and the save state utility sounds amazing too!
     
  11. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Thanks! Re: the pixel->UV conversion, the reason BuildAnimation() doesn't do this is because the UVAnimation class doesn't have access to the Sprite's material and therefore can't perform the conversion because that requires knowing the texture's dimensions. But this will all be incredibly easier in SM2. In fact, I just posted a brief preview/overview video here:

    http://www.anbsoft.com/middleware/sm2/overview
     
  12. twomack33

    twomack33

    Joined:
    May 14, 2009
    Posts:
    10
    Thanks for the demonstration of SM2. What price range are you all thinking about right now and when are you thinking of releasing it?
     
  13. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    I'm trying to have it ready to show at Unite. It's in release candidate phase, so I'm about ready to take orders at a discount for those who want to go ahead and start using the release candidate.

    The un-discounted price point will be between $50 and $75.

    Thanks for the interest!
     
  14. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    I'm now accepting limited orders for those wishing to start using SpriteManager 2 1.0 Release Candidate 1 right away! By "limited", I'm offering a coupon code here that is good for a 10% Early-Adopter discount for the first 10 customers.

    REPEAT: This coupon code is only good for the first 10 customers, so hurry, and be sure to pay attention at checkout in case the coupon code has been used up.

    IMPORTANT: Before you order, check the SpriteManager 2 page for support information:
    http://www.anbsoft.com/middleware/sm2

    The prices are as follows:
    $75 per-seat license
    $275 studio license (unlimited seats for your studio)

    In other words, if you're a 2-man shop, you will need to purchase a license for each person who will be using SM2. If your studio has 4 or more employees, you're better off with the studio license.

    You will be provided with a download of 1.0 RC1 in a .zip. Inside the .zip are 2 unitypackage files (the basic SM2 package and a demo package), and a .zip containing the documentation. Also note that sometimes OSX wants to decompress .unitypackage files as well when it unzips a zip. If this happens, try using a 3rd Party tool instead like StuffIt Expander.

    Here is the coupon code:
    CPN0845259699

    For those who haven't seen it yet, you can find out more about SpriteManager 2 in the overview video here:
    http://www.anbsoft.com/middleware/sm2/overview

    Here are the direct links:
    SM2 Single-user:
    http://store.eSellerate.net/anbsoft/sm2su

    SM2 Studio
    http://store.eSellerate.net/anbsoft/sm2studio


    Have fun!
     
  15. imparare

    imparare

    Joined:
    Jun 24, 2008
    Posts:
    369
    I have been fortunate enough to be a small part of this with Brady for some time now and I have to say it totally rocks.

    As a coder it means huge savings not only on coding time but also on not having to involve a Designer in building an atlas. All I need are the pngs and I am good to go.

    Massive recommendation from me and really can't speak highly enough of this product.
     
  16. Dark-Table

    Dark-Table

    Joined:
    Nov 25, 2008
    Posts:
    315
    I think this only happens with the .unityPackage is the only file found in the archive. I think it assume it's some kind of tar.gz situation.

    I purchased and downloaded SM2 and it extracted fine.

    I don't want to tell the artist I'm working with about it. He's been building spritesheets for a week, and I think finding out they can be built automatically (with variable frame sizes) might kill him.
     
  17. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Hah! I know the feeling, believe me! SpriteManager (1 2) was made largely out of my own experience in dealing with all of this with my own games. SM2 is going to be a HUGE time-saver for everyone (pays for itself very quickly that way), but you just might shed a little tear over all that work you wouldn't have had to do if you had had it sooner. :) Thanks a bunch and I hope you enjoy using it!
     
  18. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Haha, I have also been fortunate enough to have experience a small part of Brady's SM2 Dev period. As a Designer I was creating my own animated Sprites on screen in seconds and thinking, Wow I needed a Dev to do this before now! so those Designers out there who are budding Dev's might just be thinking about keeping it secret from the Dev's too! not to mention the joy of Atlas space saving with non uniform sprites... no more making Atlas Legends either.

    The stuff Brady is doing really does rock!
     
  19. anthropophagy

    anthropophagy

    Joined:
    Apr 28, 2009
    Posts:
    10
    I just picked up my copy. Thanks a ton Brady, everything you've done so far has been outstanding.
     
  20. Rainville

    Rainville

    Joined:
    Aug 18, 2009
    Posts:
    45
    Wow this looks fantastic!

    two questions:

    1. I use Unity on my mac (desktop) and my pc (laptop), will I have to purchase two licenses? :S

    2. I watched the tutorial and it seems adding an animation is very straightforward. But how about having several animations on one GameObject, so that by pressing right or left (or spacebar to jump) would trigger the corresponding animation? Is that doable?
    Thanks a lot
     
  21. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Thanks a lot! I really appreciate that. By the way, if you haven't seen it already, be sure to check out the tutorial video (linked on the SM2 page):
    http://www.anbsoft.com/middleware/

    Thanks for your interest! My answers below:

    1. No. It's per-seat, as opposed to per-computer. So it just depends on how many people are part of your team. If it's just you, then a single license will suffice. You can use as many computers as you need to get your work done. :)

    2. Yes, it is made to do this. If you'll notice in the video, you can enter the number of animations on that particular GO. You can give them names and trigger them from script using the names, or you can trigger them by index as well (faster). And in the full 1.0 release, there should be a couple of extra features that make this even better with the ability to automatically revert to an "idle" animation once a particular animation has finished playing.
     
  22. Rainville

    Rainville

    Joined:
    Aug 18, 2009
    Posts:
    45

    SOLD!!
    So is the version we're buying now not the 1.0 release? you mention extra features in the "full 1.0". Will early adopters of SM2 (ie: me in about 5 minutes) receive an update for the "full" version when its ready or will it be a case of re-purchasing?
    Thanks again for this amazing add-on!
     
  23. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Yes, early-adopters get a full license for the official 1.0 release. That would be cruel to do otherwise. :)

    Speaking of which, I guess I'd better let the cat out of the bag so there aren't any surprises: I'm going to do another %10 discount that will last from the beginning of Unite to the end in honor of the event.

    Also, ontop of that, if you add SM2 to your cart and proceed to check out, you should see an offer on the right-hand side to get the "Sprite and EZ Game Saver Bundle". If you get both together, you'll save another $25.
     
  24. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    This looks really, really slick.

    I've got a few questions, but I'll check the videos first to see if they contain the answers...
     
  25. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    Does sprite manager handle collision detection?

    Does everything work on indie?

    Also I assume Unite hasn't started yet? Because it does not appear to offer me the discount. I also don't see the 'saver bundle'.
     
  26. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    SM2 does not perform any collision detection, no. For that, I would recommend either compound colliders, or convex mesh colliders.

    Yes, it works on Indie and will work for any Unity build target. Though you'll still have extra draw calls in "regular" (non-iPhone) Unity until they implement batching in "regular" Unity (which I hear is on its way). But desktop games aren't nearly as sensitive to drawcalls as iPhone games anyway. But if for some reason batching takes a long time to get implemented in regular Unity, I'll probably go ahead and add a manager script option to combine the draw calls.

    The Unite discount coupon will be available tomorrow even though Unite doesn't start until Tuesday, and will be available through the 31st. Watch this thread for the coupon code. As for the bundle, it should show up on the right-hand side when you check out. It'll have an "Add to Cart" button below it.
     
  27. Rainville

    Rainville

    Joined:
    Aug 18, 2009
    Posts:
    45

    so putting a collider on a gameobject with sprite manager would do the trick?

    sorry, still quite new with Unity..
     
  28. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Yes, more or less. In the Unity docs, it explains the various interactions between colliders/triggers based on whether the object that bears them has a rigidbody, a kinematic rigidbody, or no rigidbody, etc.

    There are lots of ways to implement collision detection, depending on your game type. If you just want to know when two objects intersect, and then handle the response yourself, you can use a combination of static trigger colliders (for your world geometry) and kinematic rigidbody with collider for your characters. Or if you want full PhysX physics collision and response, just put a rigidbody on your objects and set 'em loose. :)

    Look under the Physics Components section of the reference manual for all the details.
     
  29. bobber205

    bobber205

    Joined:
    May 12, 2009
    Posts:
    139
    Awesome product. Will buy soon! :D
     
  30. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Okay! The sale starts today in honor of Unite. 10% off your entire order, and don't forget the SM2/EZ Game Saver bundle deal as well (save an additional $25). The coupon code for the 10%-off discount is:
    CPN3774321538

    This will continue through the 31st, so have fun!

    http://www.anbsoft.com/middleware

    Gotta go catch my plane to San Francisco now... :) I hope to see some of you there! But if you have any trouble with the bundle working (apparently it's not showing up for everyone for some reason), drop me a message and I'll get it worked out for you.
     
  31. Rainville

    Rainville

    Joined:
    Aug 18, 2009
    Posts:
    45
    SOLD.
    just grabbed my copy, many thanks!

    Quick question, where should we place the .unityPackage? In our Standard Packages Unity folder? Or just in the assets folder of the individual projects?
     
  32. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    It's up to you really. It's a matter of convenience since Unity, I believe, defaults to the standard folder, but you can put it anywhere as long as you don't mind having to browse to it. :)

    Oh wait, I think I misread your question. Be sure to go to "Assets" on the menu, and select "Import package". Then you select the package and all should be imported properly.
     
  33. Divarium

    Divarium

    Joined:
    Sep 2, 2009
    Posts:
    6
    Hello Gentlemen !

    I'm currently trying to use the sprite manager to display billboard.

    To explain simply, I aim at displaying billboard on the XZ plane that face a camera oriented toward the XY plane.

    I've tried quite à few things with the Demo project but billboards doesn't seems to rotate correctly if not displayed on the XY plane.

    So I'm wondering :
    Is it even possible and if yes, how ?
     
  34. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Actually, it is not possible to rotate billboards. It has to do with the way the orientation of the billboard has to be calculated. But if your camera will always be looking in the same direction, you shouldn't need to use the billboarding feature.
     
  35. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Actually, it is not possible to rotate billboards. It has to do with the way the orientation of the billboard has to be calculated. But if your camera will always be looking in the same direction, you shouldn't need to use the billboarding feature.
     
  36. GamesByJerry

    GamesByJerry

    Joined:
    Oct 27, 2008
    Posts:
    71
    Just wanted to chime in and say that the amount of work done in the new Sprite Manager is fantastic! The only thing I could think of that would make it better right now would be having it integrated into unity natively... We can all dream ;-)

    Great work Brady!
     
  37. Divarium

    Divarium

    Joined:
    Sep 2, 2009
    Posts:
    6
    Thanks for your reply. Too bad rotating billboard is impossible. I will have to find another way to do what I want.
     
  38. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Yes, it is unfortunate. I beleieve this is the reason Unity's particles can't rotate as well.
     
  39. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    What's the correct way to install Sprite Manager 2, so it's always available in new projects?
     
  40. cheezorg

    cheezorg

    Joined:
    Jun 5, 2008
    Posts:
    394
    Just want to say fantastic job on Sprite Manager 2. So polished and well done. The tutorial videos are well produced and walked me through the whole process very easily. Very impressed Brady. Thanks for making my life easier, and at a reasonable price!

    :D :D :D :D :D :D :D :D :D
     
  41. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    tonyd:
    Actually, just like with the standard asset package, it will have to be imported into each project. So you just click on Assets->Import Package and then browse to and select the SpriteManager 2 package. All files will be properly inserted into your project.

    cheezorg:
    Thanks! I'm glad it has helped you! Keep me posted if you uncover anything that needs fixing. There's actually a semi-issue with 2.6 that was just released - as they explained to us at Unite, 2.6 has a new optimization that, by default, textures are set to be non-readable, which is a problem when trying to use them for atlas building. Also, something they changed in 2.6 causes the "auto" format setting to be incompatible with PNG export. But I had some one-on-one time with some Unity guys on this and we came up with a fix I will implement as soon as I get back home from Unite (flying back Saturday). In the meantime, you just need to mark any "source" textures (ones that are built into atlases) as readable and set their format to ARGB 32. It's tedious, but I'll soon modify the editor script to automatically do this for you.
     
  42. Maph

    Maph

    Joined:
    Sep 19, 2009
    Posts:
    55
    I also wanted to give my thanks to you, Brady!

    We're working on a new iPhone game and Sprite Manager has helped us so much throughout the process.
    We used Sprite Manager 1 when we started out, but since we needed pixel perfect sprites, I had to implement that myself, and setting up animations was quite tedious when dealing with numerous large sprite sheets. :)

    Thankfully, Sprite Manager 2 included all of that off the shelf, and I hardly have to do anything myself anymore.
    That build atlas feature is just beyond sweet.
    In all regards, Sprite Manager 2 is the best buy I've done in ages (next to Unity ofcourse).

    A couple of questions though:
    - Is it possible to build 1bit alpha png's? Or does Unity not allow this? It may save us some filesize issues.
    - How about including a public property in the animation class that states how long the animation lasts in seconds?
    Because setting the "finish on animation" - delegate isn't favorable in all situations, plus I'd rather use a single coroutine with WaitForSeconds then a bunch of "FinishUp" voids. :)
     
  43. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    If we do find a potential bug or simply have a suggestion, would you rather we posted it here or emailed you directly?

    And thanks again for releasing this! I thought I was going to have to modify my own animation script to take advantage of dynamic batching, so this saves me a ton of work... and your solution is a lot more elegant than mine would have been!
     
  44. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    First off, thanks so much for the very kind comments. Do I have your permissions to quote you?

    I'm actually not sure about that. I've never tried to do a 1-bit alpha, and since it is not on the list of texture formats in Unity, I tend to think it is not supported. But that certainly would add some texture memory savings.

    I can certainly see the usefulness of that. The only problem at the moment is that since SM2 doesn't use a custom inspector (which I'm leery of writing until they are officially supported in Unity iPhone), the fps property would conflict with a "duration" property. However, I have a plan that would resolve this and allow you to specify whichever you wished, and will add a SUPER cool feature ontop of that. But we'll have to wait and see for that... So in the meantime, what about a method that would return the calculated animation duration for use in your coroutine? Basically, you'd say, "GetAnimDuration" and it would return the duration, in seconds, based on the framerate and framecount. Would that work for you?

    tonyd:
    You can do either. In some ways it would be helpful to have it here on the forum so if multiple people discover the same thing, we can avoid duplication. But it would probably be better for me to start an SM2 thread to keep it separate from this one given that this one is now 36 pages long. :)

    Tanks again everyone!
     
  45. Maph

    Maph

    Joined:
    Sep 19, 2009
    Posts:
    55
    Quote like there's no tommorrow I'd say. :)

    I figured 1-bit alpha wouldn't be on the list, the texture compression options gave some of that away already.
    Anyway, it would be nice in the long run.

    Oh, I didn't mean a public serialized property.
    My apologies, I created a misnomer!
    A public (if not readonly) property in the uvanimation classes that isn't visible in the inspector that you can access by code is more then sufficient in my case.
    Right now I've implemented that on a higher level (the class that refers to these animations) by doing something simple like 1/frameRate * frameCount which seems to work.

    Super cool features are always nice! :)
     
  46. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Thanks!

    Ahh, I see. Okay, I'll be including precisely that feature in the next release (should be coming very soon to address new issues in 2.6).

    You're going to LOVE it if and when I get around to implementing it.
     
  47. Maph

    Maph

    Joined:
    Sep 19, 2009
    Posts:
    55
    I can't wait!

    PS: A hidden or SetVisible property/method would be sweet too. :)
     
  48. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Okay, I'll have to think about that one. In the meantime, there are a few ways you can accomplish this: set the color to "Color.clear", set the width and height to 0, or set the GameObject's active property to false.
     
  49. Maph

    Maph

    Joined:
    Sep 19, 2009
    Posts:
    55
    I tried out setting color to clear and scaling away to zero.
    You don't see the sprite anymore then, but the problem with that one is that it still triggers a draw call.

    Flagging gameObject.active does the trick though! The sprite is not visible, and no draw call is used for the object.
     
  50. JürgenBF

    JürgenBF

    Joined:
    Oct 22, 2009
    Posts:
    4
    Hey,

    Somehow I seem to be unable to get SM1 to work. I'm not quite sure on what to make of point 2 in the Usage part of the Wiki:

    "2. To use it, create GameObjects which you want to represent using sprites at run-time. Add a script to each of these objects that contains a reference to the instance of the SpriteManager script you created in step 1. "

    For a single sprite I now created an empty GameObject, attached a CS script and added the line:

    "SpriteManager sprite_manager = (SpriteManager)gameObject.AddComponent ("SpriteManager");"

    to the Start() method. Somehow this makes the SpriteManager crash in the EnlargeArrays method (see [1] for the detailed error message). Note that I did set Alloc Block Size to 10.

    Anybody willing to help me out on how to properly pass the reference of the ScriptManager to a sprite? Thanks already.




    [1] ArgumentException: An invalid argument was specified.
    System.Array.CopyTo (System.Array array, Int32 index)
    SpriteManager.EnlargeArrays (Int32 count) (at Assets\Scripts\SpriteManager.cs:318)