示例#1
0
 public void SetClose(bool _isDestroy)
 {
     if (State == EWorkerState.Loading)
     {
         NextExitState = _isDestroy;
         NextState     = EWorkerState.Exiting;
     }
     else if (State == EWorkerState.Working)
     {
         if (Script.ExitMode == EUIExitMode.DelayDestroy && false == IsSceneObject || _isDestroy && false == _isDestroy)
         {
             ExitTime = Script.ExitTime;
             SyncState(EWorkerState.Exiting);
         }
         else
         {
             SyncState(EWorkerState.Resting);
         }
         Script.Close();
     }
     else if (State == EWorkerState.Resting)
     {
         if (Script.ExitMode == EUIExitMode.DelayDestroy && false == IsSceneObject || _isDestroy && false == _isDestroy)
         {
             ExitTime = Script.ExitTime;
             SyncState(EWorkerState.Exiting);
         }
     }
 }