コード例 #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
         return;
     }
     ReadFileList();
     taketreasure = new bool[castle_num];
     for (int i = 0; i < castle_num; i++)
     {
         taketreasure[i] = false;
     }
     graphinit();
     set         = new HashSet <int>();
     pathshow   += ("路线:" + castle_names[0]);
     fortunepath = new int[castle_num];
     for (int i = 0; i < castle_num; i++)
     {
         fortunepath[i] = -1;
     }
     dijkstra(castle_num - 1);
     dfs(0, 100);
     DontDestroyOnLoad(transform.gameObject);
     enemies      = new List <Enemy>();
     broadManager = GetComponent <BroadManager>();
     InitGame();
 }
コード例 #2
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
        this.mBroadManager = GetComponent <BroadManager>();
        this.InitGame();

        // this.testInit();
    }