Search Unity

Don't Load Level

Discussion in 'Scripting' started by kurucc, Apr 12, 2014.

  1. kurucc

    kurucc

    Joined:
    Feb 15, 2014
    Posts:
    8
    How can i disable the level loading?
     
  2. mafiadude1

    mafiadude1

    Joined:
    Jun 28, 2012
    Posts:
    59
    Why would you need to?
     
  3. kurucc

    kurucc

    Joined:
    Feb 15, 2014
    Posts:
    8
    I just want to disable the level loading.. but how can i do this?
     
  4. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    You can create a script that handles level loading...
    Code (csharp):
    1.  
    2. function LoadLevel (levelName : String) {
    3.     if (enabled) {
    4.         Application.LoadLevel (levelName);
    5.     }
    6. }
    7.  
    And disable the component when you don't want to be able to load the level.
     
    Last edited: Apr 16, 2014
  5. kurucc

    kurucc

    Joined:
    Feb 15, 2014
    Posts:
    8
    Thank You!