Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

the best way to optimize platform game 2D?

Discussion in '2D' started by Green-Jungle, Dec 4, 2015.

  1. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    Hello everyone.I've made some of platform game.I have also the problems about optimize.
    So I use Pool Manager to spawn such a enemies,Particles,...
    I still don't really know how to optimize best.
    Right now the way i'm working as create all static platforms and then I have a list GameObject to spawn correct position kind of enemies on platform.But I find that do this take a lot time when I should drag enemies in prefabs to List.And I don't really this way can optimize?
    Can everyone give me any suggestion?
    Thank you so much.
    Sorry my English.
     
  2. codeedward

    codeedward

    Joined:
    Dec 19, 2014
    Posts:
    93
    What do you mean writing 'when I should drag enemies in prefabs to List'?
    I see that with Pool Manager you need to just connect one prefab to create App polling to them. So what is the problem?
    Also think about using something like Sprite Manager or Atlas maker to optimize batches. In my case it was one of the main think when I created gui for game.
     
    Green-Jungle likes this.
  3. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    I mean.When do you need spawn Enemies on Scenes? You will spawn all Enemies when start game in Start() method or you will spawn enemies only when Player reach enemies with specific distance.Thanks.
     
  4. codeedward

    codeedward

    Joined:
    Dec 19, 2014
    Posts:
    93
    I don't have enough experience to tell you professional solution, but in my opinion it is better to Instantiate them in Awake. Then you will only enable them and this won't affect your performence so much. In that case everything will be prepared and waited for a good moment (mean distance reached). So we could think about il like do everything costly in Loading... time, before starting game scene. If I am wrong, correct me please ;)
     
    Green-Jungle likes this.
  5. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    I aslo will try your way.I think your good idea.Problems's about Performance always important. :)