コード例 #1
0
 void DetectiveWallUpdate()
 {
     //Pinning
     if (CursorMode == DetectiveCursorMode.Idle || CursorMode == DetectiveCursorMode.Pinning)
     {
         //Try pinning
         if (Input.GetMouseButtonDown(0))
         {
             TryPinning();
         }
         //Change color
         else if (Input.GetMouseButtonDown(1))
         {
             if (activePinStringGrp != null)
             {
                 activePinStringGrp.ToggleColor();
             }
         }
     }
     //Destroy pin
     else if (CursorMode == DetectiveCursorMode.Pinning && Input.GetKeyDown(KeyCode.Escape))
     {
         DestroyActivePins();
         CursorMode = DetectiveCursorMode.Idle;
     }
     //Moving pin
     else if (CursorMode == DetectiveCursorMode.MovingPin)
     {
         //Finish moving
         if (Input.GetMouseButtonUp(0))
         {
             //maybe put these in a seperate TryFinishMovePin() method
             activePinStringGrp.FinishMoving();
             activePinStringGrp = null;
             CursorMode         = DetectiveCursorMode.Idle;
         }
         //Change color
         else if (Input.GetMouseButtonDown(1))
         {
             activePinStringGrp.ToggleColor();
         }
         //Destroy
         else if (Input.GetKeyDown(KeyCode.Escape))
         {
             DestroyActivePins();
         }
     }
 }