Search Unity

Unity Editor Clutter

Discussion in 'General Discussion' started by BKGamesStudio, Jan 20, 2017.

  1. BKGamesStudio

    BKGamesStudio

    Joined:
    Dec 9, 2016
    Posts:
    12
    Is there any way to reduce the clutter in the unity editor. When adding button click events the list goes off the screen.
    upload_2017-1-20_1-39-47.png
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I would suggest using DRY principles to reduce the number of public methods you have. Why not make one method, public void Level (int levelNumber). That can call other methods as needed. Then make the other level methods private.

    In general terms the less public members you have, the better.
     
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    What he said.

    Level01..Level10 just screams for Level(int number) parameter. Alternatively you could create individual components for each level, in this case methods for each one of them will be visible in their own menus.
     
    carking1996, Ryiah and Kiwasi like this.
  4. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Code (CSharp):
    1. public void LoadLevel (int lvl){
    2.      if(lvl == 0){
    3.           //do something
    4.      }
    5. }
     
    passerbycmc and Ryiah like this.