コード例 #1
0
 public void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     UnlockedLevelCount = LoadUnlockedCount();
     gameObjects        = new List <GameObject>();
     menuScript         = gameObject.GetComponent <MenuScript>();
     guiScript          = gameObject.AddComponent <GuiScript>();
     gridScript         = gameObject.AddComponent <GridScript>();
     levelScript        = gameObject.AddComponent <LevelsScript>();
     levelCount         = LevelsScript.LEVEL_COUNT;
     SetGameGrid(GRID_DIMENSION, GRID_DIMENSION, gamePanel);
     SetMenu();
 }