コード例 #1
0
ファイル: Screen.cs プロジェクト: 207h2Flogintvg/LGame
 public virtual void Destroy()
 {
     lock (this)
     {
         if (useScreenListener)
         {
             foreach (ScreenListener t in screens)
             {
                 t.Dispose();
             }
         }
         useScreenListener = false;
         replaceLoading = false;
         replaceDelay.SetDelay(10);
         tx = ty = 0;
         isClose = true;
         CallEvents(false);
         isTranslate = false;
         isNext = false;
         isGravity = false;
         isNext = false;
         isLock = true;
         if (sprites != null)
         {
             sprites.Dispose();
             sprites = null;
         }
         if (desktop != null)
         {
             desktop.Dispose();
             desktop = null;
         }
         if (currentScreen != null)
         {
             LTexture parent = currentScreen.GetParent();
             if (parent != null)
             {
                 parent.CloseChildAll();
                 parent.Destroy();
             }
             else
             {
                 currentScreen.Destroy();
             }
             currentScreen = null;
         }
         if (gravityHandler != null)
         {
             gravityHandler.Dispose();
             gravityHandler = null;
         }
         if (releases != null)
         {
             foreach (LRelease r in releases)
             {
                 if (r != null)
                 {
                     r.Dispose();
                 }
             }
             CollectionUtils.Clear(releases);
         }
         Dispose();
     }
 }
コード例 #2
0
ファイル: Screen.cs プロジェクト: 207h2Flogintvg/LGame
 public virtual GravityHandler SetGravity(bool g)
 {
     if (g && gravityHandler == null)
     {
         gravityHandler = new GravityHandler();
     }
     this.isGravity = g;
     return gravityHandler;
 }
コード例 #3
0
ファイル: Screen.cs プロジェクト: hellogithubtesting/LGame
 public void Destroy()
 {
     lock (this)
     {
         useKeyListener = false;
         useTouchListener = false;
         replaceLoading = false;
         replaceDelay.SetDelay(10);
         tx = ty = 0;
         isClose = true;
         CallEvents(false);
         isTranslate = false;
         isNext = false;
         isGravity = false;
         isCamera = false;
         isLock = true;
         if (touchs != null)
         {
             touchs.Clear();
             touchs = null;
         }
         if (keys != null)
         {
             keys.Clear();
             touchs = null;
         }
         if (sprites != null)
         {
             sprites.Dispose();
             sprites = null;
         }
         if (desktop != null)
         {
             desktop.Dispose();
             desktop = null;
         }
         if (currentScreen != null)
         {
             LTexture parent = currentScreen.GetParent();
             if (parent != null)
             {
                 parent.CloseChildAll();
                 parent.Destroy();
             }
             else
             {
                 currentScreen.Destroy();
             }
             currentScreen = null;
         }
         if (gravityHandler != null)
         {
             gravityHandler.Dispose();
             gravityHandler = null;
         }
         camera = null;
         if (releases != null)
         {
             foreach (LRelease r in releases)
             {
                 if (r != null)
                 {
                     r.Dispose();
                 }
             }
             releases.Clear();
         }
         Dispose();
     }
 }