コード例 #1
0
 public void PerformAction(Actions action)
 {
     switch (action)
     {
         case Actions.StartTimer:
             game.objectiveManager.Countdown(3);
             break;
         case Actions.ResetTimer:
             game.objectiveManager.Reset();
             break;
         case Actions.Open:
             Thread openThread = new Thread(DoOpen);
             openThread.SetApartmentState(ApartmentState.STA);
             openThread.Start();
             break;
         case Actions.Reload:
             Thread reloadThread = new Thread(DoReload);
             reloadThread.SetApartmentState(ApartmentState.STA);
             reloadThread.Start();
             break;
         case Actions.Save:
             Thread saveThread = new Thread(DoSave);
             saveThread.SetApartmentState(ApartmentState.STA);
             saveThread.Start();
             break;
         case Actions.PropertyEditor:
             FormManager.Property.Show();
             break;
         case Actions.Copy:
             FormManager.Property.CopySelected();
             break;
         case Actions.Delete:
             KinectRagdollGame.pendingUpdates.Add(delegate() { FormManager.Property.DeleteSelected(); });
             break;
         case Actions.Freeze:
             KinectRagdollGame.pendingUpdates.Add(delegate() { FormManager.Property.FreezeSelected(); });
             break;
         case Actions.Release:
             KinectRagdollGame.pendingUpdates.Add(delegate() { FormManager.Property.UnfreezeSelected(); });
             break;
         case Actions.ToggleCamera:
             game.ragdollManager.CameraShouldTrack = !game.ragdollManager.CameraShouldTrack;
             break;
         case Actions.PowerupEditor:
             object[] selection = FormManager.Property.getSelectedObjects();
             if (selection.Length > 0)
             {
                 PowerupForm p = new PowerupForm();
                 p.Show(selection);
             }
             
             break;
         case Actions.ToggleFullScreen:
             game.ToggleFullscreen();
             break;
     }
 }
コード例 #2
0
        public void PerformAction(Actions action)
        {
            switch (action)
            {
            case Actions.StartTimer:
                game.objectiveManager.Countdown(3);
                break;

            case Actions.ResetTimer:
                game.objectiveManager.Reset();
                break;

            case Actions.Open:
                Thread openThread = new Thread(DoOpen);
                openThread.SetApartmentState(ApartmentState.STA);
                openThread.Start();
                break;

            case Actions.Reload:
                Thread reloadThread = new Thread(DoReload);
                reloadThread.SetApartmentState(ApartmentState.STA);
                reloadThread.Start();
                break;

            case Actions.Save:
                Thread saveThread = new Thread(DoSave);
                saveThread.SetApartmentState(ApartmentState.STA);
                saveThread.Start();
                break;

            case Actions.PropertyEditor:
                FormManager.Property.Show();
                break;

            case Actions.Copy:
                FormManager.Property.CopySelected();
                break;

            case Actions.Delete:
                KinectRagdollGame.pendingUpdates.Add(delegate() { FormManager.Property.DeleteSelected(); });
                break;

            case Actions.Freeze:
                KinectRagdollGame.pendingUpdates.Add(delegate() { FormManager.Property.FreezeSelected(); });
                break;

            case Actions.Release:
                KinectRagdollGame.pendingUpdates.Add(delegate() { FormManager.Property.UnfreezeSelected(); });
                break;

            case Actions.ToggleCamera:
                game.ragdollManager.CameraShouldTrack = !game.ragdollManager.CameraShouldTrack;
                break;

            case Actions.PowerupEditor:
                object[] selection = FormManager.Property.getSelectedObjects();
                if (selection.Length > 0)
                {
                    PowerupForm p = new PowerupForm();
                    p.Show(selection);
                }

                break;

            case Actions.ToggleFullScreen:
                game.ToggleFullscreen();
                break;
            }
        }