Ejemplo n.º 1
0
    public int seat; //记录船上的物体位置
    public static GetOffTheBoat GetSSAction(int seat)
    {
        GetOffTheBoat action = ScriptableObject.CreateInstance <GetOffTheBoat>();

        action.seat = seat;
        return(action);
    }
Ejemplo n.º 2
0
 protected new void Update()
 {
     if (SceneController.state == FirstController.GameState.WIN || SceneController.state == FirstController.GameState.LOSE)
     {
         return;
     }
     if (Input.GetMouseButtonDown(0) && SceneController.state == STOP)
     {
         Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit))
         {
             if (hit.transform.tag == "Devil" || hit.transform.tag == "Priest")
             {
                 if (hit.collider.gameObject == SceneController.ship[0] || hit.collider.gameObject == SceneController.ship[1]) //下船
                 {
                     if (hit.collider.gameObject == SceneController.ship[0])
                     {
                         j = GetOffTheBoat.GetSSAction(0);
                         this.RunAction(hit.collider.gameObject, j, this);
                     }
                     else
                     {
                         j = GetOffTheBoat.GetSSAction(1);
                         this.RunAction(hit.collider.gameObject, j, this);
                     }
                 }
                 else //上船
                 {
                     i = GetOnTheBoat.GetSSAction();
                     this.RunAction(hit.collider.gameObject, i, this);
                 }
             }
             else if (hit.transform.tag == "Boat" /* && SceneController.Capacity != 2*/) //移动船
             {
                 k = MoveTheBoat.GetSSAction();
                 this.RunAction(hit.collider.gameObject, k, this);
             }
         }
     }
     base.Update();
 }