Unity Community |

Stuff like this is popping up in the Console using Unity Beta 3.5:
Assets/Editor/AnBSoft/Wizards/BuildAtlases.cs(291,80): warning CS0618: `UnityEditor.EditorUtility.GetPrefabType(UnityEngi ne.Object)' is obsolete: `Use PrefabUtility.GetPrefabType'
@jrricky
No, the problems with 3.5 were on Unity's side, and should have been resolved by the current beta. However, there are still issues with Flash export which are yet to be resolved. The warning you mentioned is just a deprecation warning that doesn't cause any functionality problems, but it has been addressed in the internal development version that will be released soon.
@KokonutStudio
Thanks for the great feedback!
Brady, I was wondering if you had any plans to package up EZ Animator on it's own at any stage? I purchased SM2 a long time ago and I really want to give EZ Animator a try but I don't really have any need for EZ GUI and unfortunately I'm not wealthy enough to buy it just for the animator.
I've tried Ani.Mate and iTween but I'd much rather use something that is specifically designed to work with SM, kind of defeats the point on saving on all those draw calls otherwise![]()
Thanks for the question. At the moment, I don't have any plans to break it out into a separate package. Since for performance reasons it needs to know ahead of time about the various specialized classes upon which it operates, it would need to be stripped down to work only with SM2 since SM2 lacks some of the other classes that it supports, so you would get compiler errors (and C# and Unity currently lack any way to do project-scope preprocessors that would otherwise resolve this). If it were altered to be more generic, then performance would suffer due to a need to use runtime reflection, etc.
Hi Brady
I'm using SM2 for 2D animations. In my set up i have 2 buttons: one starts the animation, the other stops the animation.
This works fine (using PlayAnim("anim"), and StopAnim()), however, when I press button one again to play the animation again (2nd time), the animation doesn't play.
I do have other events occurring when the buttons are pressed, and they are working fine, so I know it's not the code to press the button etc, and i've basically broken it down to an issue with SM2. (edit: or my use of SM2)
Does anyone use SM2 who might be able to shed some light on this?
Hi - noone can help with this? I've tried various hacks with no luck. Even tried a simple single push button to Start/Stop/Start and still no luck with the animation playing the second time with PlayAnim.
It sounds like it might be some kind of logic error. Try using DoAnim() just to see (DoAnim uses some internal logic to ignore repeated requests to play an animation if the requested animation is already playing).
Hi Brady,
Since moving to 3.5, our team has noticed massive memory spikes when building atlases. Building a small (1024x1024 atlas) gives me a 350MB increase in memory use which is never returned. After building a few atlases, we're having to shut down Unity and restart, which is frustrating. We weren't monitoring memory use before upgrading to 3.5 so cannot say for certain that it wasn't happening, but it has magically become an issue since we upgraded to 3.5 so we're thinking it's more likely than not related to 3.5. Are you aware of any issues or solutions? Should we be reporting this to Unity?
Experienced Game Developer Available for Freelance/Contract Work - My Portfolio
That definitely sounds like something to be reported to Unity. I'll be looking into this as well, and I think I may have a strategy to help. But even so, it sounds like something Unity needs to be aware of.
Hi Brady.
I have run into a small issue. I dont know if I am missing something but I have made a bunch of PackedSprite objects.
I check hideAtStart in the editor.
But when I later try to unhide them by calling mySprite.Hide(false) they do not get displayed.
If I dont mark hideAtStart in the editor but hide them with code in my Start() function, mySprite.Hide(false) works as intended.
Could it be something with hideAtStart?? The PackedSprite objects are inside a prefab if it makes any difference.
Thanks in advance
/Peter
Hi Brady
I feel as though the answer to my problem should be simple, and I'm missing something...
I want to set the Alpha of a PackedSprite to 50% on an instance of an object. I can't set this at the material side, as the atlas is used across many objects in the scene.
So, i thought i'd set the colour of the packed sprite on the individual object instead.
So far i have:
However, whilst the alpha side works, the COLOUR is changed from the object's default white to Black, and hence doesn't make the sprite look correct under alpha (i.e. you see a black alpha'd square rather than the detail of the image inside the square, if that makes sense).
What am I doing wrong?
Thanks
accidental second post - how do i remove this?
Last edited by mangoblue; 03-13-2012 at 07:53 PM.
@Hungariano
I can't think of what would cause that off the top of my head. All Hide() does is disables the mesh renderer (or if the sprite is managed, it sets its vertices to 0,0,0). Are you using the latest version of SM2?
@mangoblue
This is because by default your color variable is probably 0,0,0,0, and you're only changing the alpha component. Try something like this instead:
var newColor : Color = thisSprite.color;
newColor.a = 0.5f;
thisSprite.SetColor(newColor);
or even easier, you should be able to just do:
thisSprite.Color.a = 0.5f;
Just be sure to use the upper-case 'C' here.
How can I have an animation for something like 'stop', 'walk', 'run'. I have an static variable that shows me when my character is moving, I want that while true, my character starts walking (one animation), then runs (loop), until the static variable reads false, then stop walking (play this just once), stop (static frame).
With this I get as far as "running", but then for "slowing down", or walking away, I don't know what to do.
http://codepad.org/r6OgVsGm
Thanks.
Hey Brady, don't remember if I asked before, but why does SM2/EG look like this in 3.5?
![]()
@davidc02
I think that instead of using a counter (which won't show you what direction you're going, i.e. whether you're slowing down or speeding up), you should use an enum. Or I suppose you could use a counter and then combine it with a signed value that indicates which direction things are going. But fundamentally it's just an issue of finding a logic pattern that works for what you're doing, and then call DoAnim() to play the appropriate animation.
@jrricky
You need to get the latest version. 3.5 changed some of the way controls get laid out.
Thanks I did!@davidc02
I think that instead of using a counter (which won't show you what direction you're going, i.e. whether you're slowing down or speeding up), you should use an enum. Or I suppose you could use a counter and then combine it with a signed value that indicates which direction things are going. But fundamentally it's just an issue of finding a logic pattern that works for what you're doing, and then call DoAnim() to play the appropriate animation.
@jrricky
You need to get the latest version. 3.5 changed some of the way controls get laid out.![]()
I know this will sound like a terrible question but how do I swap images from with in the same atlas? So say I have objectX, using materialX. MaterialX is an atlas with a dozen sprites. How do I swap image 3 to image 2?
bVd
This is demonstrated in the sample project that comes with SM2. Just have each "image" as a single-frame animation, and then just "play" that "animation", which will switch it to that image. Alternatively, you could put all the images into a single animation and set the framerate to 0, and then call PlayAnim() and pass in the animation and then the frame number.
Ok,
I am looking to change the image on event, so onTriggerEnter... Change image.
bVd