コード例 #1
0
 // Update is called once per frame
 void Update()
 {
     if (pPlate2.getIsOn())
     {
         if (pPlate1.getIsOn() && !(pPlate3.getIsOn()))
         {
             pPlate1.off();
             pPlate2.off();
         }
         if (pPlate3.getIsOn() && pPlate1.getIsOn() && done)
         {
             Destroy(cube);
             gc.GetComponent <GameController> ().roomPuzzle [9] = 1;
             done = false;
         }
     }
     if (pPlate1.getIsOn() && !(pPlate2.getIsOn()))
     {
         pPlate1.off();
     }
     if (pPlate3.getIsOn() && !(pPlate2.getIsOn()))
     {
         pPlate3.off();
     }
 }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        if (pPlateView.getIsOn())
        {
            for (int i = 1; i < pPlates.Length - 1; i++)
            {
                if (!pPlates [i].getIsOn())
                {
                    pPlates [i].visible();
                }
            }
        }
        else
        {
            for (int i = 1; i < pPlates.Length - 1; i++)
            {
                if (!pPlates [i].getIsOn())
                {
                    pPlates [i].invisible();
                }
            }
        }

        if (pPlates [1].getIsOn() && pPlates [2].getIsOn() && pPlates [3].getIsOn() && pPlates [4].getIsOn())
        {
            pPlates [5].gameObject.SetActive(true);
        }

        if (pPlates [5].getIsOn() && done)
        {
            gc.GetComponent <GameController> ().roomPuzzle [9] = 3;
            done = false;
        }
    }
コード例 #3
0
 // Update is called once per frame
 void Update()
 {
     /*
      *      if (pPlate2.getIsOn()) {
      *              if (pPlate1.getIsOn () && !(pPlate3.getIsOn ())) {
      *                      pPlate1.off ();
      *                      pPlate2.off ();
      *              }
      *              if (pPlate3.getIsOn () && pPlate1.getIsOn ()) {
      *                      Destroy (cube);
      *                      //gc.GetComponent<GameController> ().roomPuzzle [25] = true;
      *              }
      *      }
      *      if (pPlate1.getIsOn() && !(pPlate2.getIsOn())) {
      *              pPlate1.off ();
      *      }
      *      if (pPlate3.getIsOn() && !(pPlate2.getIsOn())) {
      *              pPlate3.off ();
      *      }
      */
     if (pPlate1.getIsOn() && pPlate2.getIsOn() && pPlate3.getIsOn())
     {
         Destroy(cube);
     }
 }