コード例 #1
0
    void Awake()
    {
        Ins = this;
        //if (!InitGlobalIns()) return;

        SceneManager.sceneLoaded += OnSceneLoaded;
        InspectorEventSignals.OnEnemySwitchDirCountUpdated += OnEnemySwitchDirCountUpdated;
        InspectorEventSignals.OnSpawnEnemyInspectorUpdated += OnSpawnEnemyInspectorUpdated;
        GameEventSignals.OnEnemySpawned    += OnEnemySpawned;
        GameEventSignals.OnSceneConfigured += OnSceneConfigured;
    }
コード例 #2
0
 bool InitGlobalIns()
 {
     if (Ins == null)
     {
         Ins = this;
     }
     else if (Ins != this)
     {
         DestroyImmediate(gameObject);
         return(false);
     }
     DontDestroyOnLoad(gameObject);
     return(true);
 }