Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetMouseButtonDown(0) && isOver == 0)
     {
         Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit))
         {
             if (hit.transform.tag == "Priest" || hit.transform.tag == "Devil")
             {
                 if (ssdirector.offBoat(hit.collider.gameObject) == false)
                 {
                     ssdirector.onBoat(hit.collider.gameObject);
                 }
                 else
                 {
                     isOver = ssdirector.checkWin();
                 }
             }
             else if (hit.transform.tag == "Boat")
             {
                 ssdirector.moveBoat();
                 isOver = ssdirector.checkLose();
             }
         }
     }
 }