Exemplo n.º 1
0
    void Awake()
    {
        Ins = this;
        //if (!InitGlobalIns()) return;
        RegisterAllAudioClipBundles();

        SceneManager.sceneLoaded            += OnSceneLoaded;
        GameEventSignals.OnMissileExplode   += OnMissileExplode;
        GameEventSignals.OnCannonFire       += OnCannonFire;
        GameEventSignals.OnCannonFailToFire += OnCannonFailToFire;
    }
Exemplo n.º 2
0
 bool InitGlobalIns()
 {
     if (Ins == null)
     {
         Ins = this;
     }
     else if (Ins != this)
     {
         DestroyImmediate(gameObject);
         return(false);
     }
     DontDestroyOnLoad(gameObject);
     return(true);
 }
Exemplo n.º 3
0
 void Start()
 {
     instance = this;
 }