コード例 #1
0
 private static void doVariousThingsForHeadsetBeingWorn()
 {
     if (Headset.isApparentlyBeingWorn)
     {
         if (MoonMotionProjectMenubar.doTabToGameWhileHeadsetIsWorn)
         {
             TabTo.game();
         }
         if (UnityIs.notPlaying && MoonMotionProjectMenubar.doPlayWhileHeadsetIsWorn)
         {
             Play.editor();
         }
     }
 }
コード例 #2
0
    private static void doVariousThingsForHeadsetUnwearing()
    {
        if (headsetApparentlyBeingWornPreviously && Headset.isApparentlyNotBeingWorn)
        {
            if (MoonMotionProjectMenubar.doTabToSceneUponHeadsetUnwearing)
            {
                TabTo.scene();                          // give this a chance to execute first
            }
            if (UnityIs.playing && MoonMotionProjectMenubar.doPauseIfPlayingUponHeadsetUnwearing)
            {
                Pause.editor();
            }
        }

        headsetApparentlyBeingWornPreviously = Headset.isApparentlyBeingWorn;
    }