Esempio n. 1
0
 // Update is called once per frame
 public override void Update()
 {
     if (sceneController.boat_position == 1)
     {
         sceneController.boat_position = 0;
         while (this.transform.position != sceneController.boatStartPos)
         {
             this.transform.position = Vector3.MoveTowards(this.transform.position, sceneController.boatStartPos, 1);
         }
     }
     else if (sceneController.boat_position == 0)
     {
         sceneController.boat_position = 1;
         while (this.transform.position != sceneController.boatEndPos)
         {
             this.transform.position = Vector3.MoveTowards(this.transform.position, sceneController.boatEndPos, 1);
         }
     }
     sceneController.check();
     this.destroy = true;
     this.callback.SSActionEvent(this);
 }
Esempio n. 2
0
 // Update is called once per frame
 public override void Update()
 {
     if (sceneController.boat[side] != null)
     {
         sceneController.boat[side].transform.parent = null;
         if (sceneController.boat_position == 1)
         {
             if (sceneController.boat[side].transform.tag == "Priest")
             {
                 for (int i = 0; i < 3; i++)
                 {
                     if (sceneController.priests_end[i] == null)
                     {
                         sceneController.priests_end[i] = sceneController.boat[side];
                         sceneController.boatCapacity++;
                         break;
                     }
                 }
             }
             else if (sceneController.boat[side].transform.tag == "Devil")
             {
                 for (int i = 0; i < 3; i++)
                 {
                     if (sceneController.devils_end[i] == null)
                     {
                         sceneController.devils_end[i] = sceneController.boat[side];
                         sceneController.boatCapacity++;
                         break;
                     }
                 }
             }
         }
         else if (sceneController.boat_position == 0)
         {
             if (sceneController.boat[side].transform.tag == "Priest")
             {
                 for (int i = 0; i < 3; i++)
                 {
                     if (sceneController.priests_start[i] == null)
                     {
                         sceneController.priests_start[i] = sceneController.boat[side];
                         sceneController.boatCapacity++;
                         break;
                     }
                 }
             }
             else if (sceneController.boat[side].transform.tag == "Devil")
             {
                 for (int i = 0; i < 3; i++)
                 {
                     if (sceneController.devils_start[i] == null)
                     {
                         sceneController.devils_start[i] = sceneController.boat[side];
                         sceneController.boatCapacity++;
                         break;
                     }
                 }
             }
         }
         sceneController.boat[side] = null;
     }
     sceneController.check();
     this.destroy = true;
     this.callback.SSActionEvent(this);
 }