Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - xtr33me

Pages: [1]
1
Support / Re: Fastest way to swap animations?
« on: February 23, 2012, 12:36:23 am »
Well I was putting together the mini project with basic functionality of what I thought was best representing what the issue was and it seems to be having no issues flipping.  It is actually working perfectly.  I guess I need to dig into this further.  I may be contacting you again, but as of now I have to look into this a bit deeper.  Thanks for your reply and help!!

2
Support / Re: Fastest way to swap animations?
« on: February 22, 2012, 02:41:05 pm »
Thanks Unikron!  I am using the latest, but I did go to verify this morning to make sure and I couldn't update any higher.  If I remememebr it was 1.35.  Even though I bought this when I got Unity, I just downloaded it to use it this week when I was going through the 2D conversion.  I am currently at work, but when I get home tongiht I will try to put togehter a very basic project that I should be able to replcate what I am doing.  I will then send that off to you.  Thanks for your help and I will talk to you later!

3
Support / Fastest way to swap animations?
« on: February 22, 2012, 04:42:25 am »
I have a game similar to bejeweled that I am working on.  I originally had it in 3D, but have recently converted over to 2D.  I have a bunch of cubes that make up the board and each cube has an idle state  image (Single), infected state (animated sprite) and a dead state (single image again).  When my cubes are destroyed I call the below code.  When I was doing this in 3D before, I would just change the material on the renderer and it went very quickly.  Now it seems since I have changed over to 2D, I am getting a huge performance hit when calling the function below.

When I comment out the "anim.Play" line, the performance hit disappears.  What is the best way to change back to my idle image across all blocks destroyed.  I am not allocating any memory.  When I destroy an object, I simply scale the object down, call the method below and then scale it back up.  I also keep track of the id's so I dont have to have 2DToolkit perform a lookup by the string, but that didnt seem to increase performance much.  Guess my overall question is what is the proper way to do this without taking a hit.  Whats happeneing is when I am destroying like 8 cubes at once, it just sits there for literally a couple noticable seconds before continuing.  One last thing I have recently upgraded to 3.5 and not sure if there are any known issues right now with 2dtoolkit and the new version.  I can't say if this was happening in the older version since I have recently changed over to 2D.  Any ideas?

Code: [Select]
    void SetRandomcolor()
    {
        ColorIndex = _boardMgr.GetWeightedRandomColor();
       
         anim.Play(_boardMgr.MyBlockColors[ColorIndex].IdleAnimationIndex);

        _boardMgr.MyBlockColors[ColorIndex].NumOnBoard++;
        _boardMgr.PopulateProbabilities();

    }

Pages: [1]