void Awake()
 {
     if (Singleton == null)
     {
         Singleton = this;
         DontDestroyOnLoad(this);
         Init();
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 2
0
        protected virtual void Init()
        {
            Singleton      = this;
            onPanelChanged = p => { };
            onPanelOpen    = p => { Debug.Log("[" + name.ToUpper() + "] opens panel '" + p.name + "'."); };
            onPanelOpen    = p =>
            {
                if ((IsPanel(p, "pause") || IsPanel(p, "options")))
                {
                    optionsManager.Init();
                }
            };
            onPanelOpen = optionsManager.OnPanelsOpen;

            optionsManager.Init();
            if (autoLoadingClose)
            {
                LoadingdAnimationManager.CloseLoading();
            }
        }