Exemplo n.º 1
0
        /// <summary>
        /// Start this instance.
        /// </summary>
        public void Start()
        {
            if (_instance)
                Destroy (_instance);
            _instance = this;
            _winID = GUIUtility.GetControlID (FocusType.Passive);
            GameEvents.onGUIApplicationLauncherReady.Add (OnAppLaunchReady);
            GameEvents.onGameSceneSwitchRequested.Add (OnSceneChange);
            GameEvents.OnMapEntered.Add (Resize);
            GameEvents.OnMapExited.Add (Resize);

            if (ApplicationLauncher.Ready) {
                OnAppLaunchReady ();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Called when this object is destroyed.
 /// </summary>
 public void OnDestroy()
 {
     GameEvents.onGUIApplicationLauncherReady.Remove(OnAppLaunchReady);
     GameEvents.onGameSceneSwitchRequested.Remove (OnSceneChange);
     GameEvents.OnMapEntered.Remove (Resize);
     GameEvents.OnMapExited.Remove (Resize);
     RenderingManager.RemoveFromPostDrawQueue (0, OnDraw);
     DestroyButtons ();
     ControlUnlock ();
     if (_instance == this)
         _instance = null;
 }