예제 #1
0
 public void MoveRole(RoleModel role)
 {
     if (GUI.sign != 0)
     {
         return;
     }
     if (role.IsOnBoat())
     {
         if (boat.GetBoatSign() == 1)
         {
             boat.DeleteRoleByName(role.GetName());
             role.Move(startLand.GetEmptyPosition());
             role.GetRole().transform.parent = null;
             role.SetBoat(false);
             role.SetLand(1);
             startLand.AddRole(role);
             //Debug.Log("boat to startt");
         }
         else
         {
             boat.DeleteRoleByName(role.GetName());
             role.Move(endLand.GetEmptyPosition());
             role.GetRole().transform.parent = null;
             role.SetBoat(false);
             role.SetLand(-1);
             endLand.AddRole(role);
             //Debug.Log("boat to end");
         }
     }
     else
     {
         if (role.GetLand() == 1)
         {
             if (boat.GetEmptyNumber() == -1 || startLand.GetLandSign() != boat.GetBoatSign())
             {
                 return;
             }
             startLand.DeleteRoleByName(role.GetName());
             role.Move(boat.GetEmptyPosition());
             role.GetRole().transform.parent = boat.GetBoat().transform;
             role.SetBoat(true);
             boat.AddRole(role);
             //Debug.Log("start to boat");
         }
         else
         {
             if (boat.GetEmptyNumber() == -1 || endLand.GetLandSign() != boat.GetBoatSign())
             {
                 return;
             }
             endLand.DeleteRoleByName(role.GetName());
             role.Move(boat.GetEmptyPosition());
             role.GetRole().transform.parent = boat.GetBoat().transform;
             role.SetBoat(true);
             boat.AddRole(role);
             //Debug.Log("end to boat");
         }
     }
     GUI.sign = Check();
 }
예제 #2
0
    public void MoveRole(RoleModel role)
    {
        if (role.IsOnBoat())
        {
            LandModel land;
            if (boat.GetBoatSign() == false)
            {
                land = end_land;
            }
            else
            {
                land = start_land;
            }
            boat.DeleteRoleByName(role.GetName());
            role.Move(land.GetEmptyPosition());
            role.GoLand(land);
            land.AddRole(role);
        }
        else
        {
            LandModel land = role.GetLandModel();
            if (boat.GetEmptyNumber() == -1 || land.GetLandSign() != boat.GetBoatSign())
            {
                return;
            }

            land.DeleteRoleByName(role.GetName());
            role.Move(boat.GetEmptyPosition());
            role.GoBoat(boat);
            boat.AddRole(role);
        }

        user_gui.sign = Check();
    }
예제 #3
0
    public void MoveRole(RoleModel role)
    {
        if (GUI.sign != 0)
        {
            return;
        }
        Vector3 middlePos, endPos;

        if (role.IsOnBoat())
        {
            if (boat.GetBoatSign() == 1)
            {
                boat.DeleteRoleByName(role.GetName());
                endPos = startLand.GetEmptyPosition();
                role.SetLand(1);
                startLand.AddRole(role);
            }
            else
            {
                boat.DeleteRoleByName(role.GetName());
                endPos = endLand.GetEmptyPosition();
                role.SetLand(-1);
                endLand.AddRole(role);
            }
            middlePos = new Vector3(role.GetGameObject().transform.position.x, endPos.y, endPos.z);
            actionManager.moveRole(role.GetGameObject(), middlePos, endPos, role.roleSpeed);
            role.GetGameObject().transform.parent = null;
            role.SetBoat(false);
        }
        else
        {
            if (role.GetLand() == 1)
            {
                if (boat.GetEmptyNumber() == -1 || startLand.GetLandSign() != boat.GetBoatSign())
                {
                    return;
                }
                startLand.DeleteRoleByName(role.GetName());
            }
            else
            {
                if (boat.GetEmptyNumber() == -1 || endLand.GetLandSign() != boat.GetBoatSign())
                {
                    return;
                }
                endLand.DeleteRoleByName(role.GetName());
            }
            endPos    = boat.GetEmptyPosition();
            middlePos = new Vector3(endPos.x, role.GetGameObject().transform.position.y, endPos.z);
            actionManager.moveRole(role.GetGameObject(), middlePos, endPos, role.roleSpeed);
            role.GetGameObject().transform.parent = boat.GetGameObject().transform;
            role.SetBoat(true);
            boat.AddRole(role);
        }
        GUI.sign = gameStatusManager.CheckGame();
    }
예제 #4
0
파일: Controller.cs 프로젝트: Jan-Jsr/3D-
    public void MoveRole(RoleModel role)    //移动角色
    {
        if (user_gui.sign != 0)
        {
            return;
        }
        if (role.IsOnBoat())
        {
            LandModel land;
            if (boat.GetBoatSign() == -1)
            {
                land = end_land;
            }
            else
            {
                land = start_land;
            }
            boat.DeleteRoleByName(role.GetName());

            Vector3 end_pos    = land.GetEmptyPosition();                                                      //动作分离版本改变
            Vector3 middle_pos = new Vector3(role.getGameObject().transform.position.x, end_pos.y, end_pos.z); //动作分离版本改变
            actionManager.moveRole(role.getGameObject(), middle_pos, end_pos, role.move_speed);                //动作分离版本改变

            role.GoLand(land);
            land.AddRole(role);
        }
        else
        {
            LandModel land = role.GetLandModel();
            if (boat.GetEmptyNumber() == -1 || land.GetLandSign() != boat.GetBoatSign())
            {
                return;                                                                            //船没有空位,也不是船停靠的陆地,就不上船
            }
            land.DeleteRoleByName(role.GetName());

            Vector3 end_pos    = boat.GetEmptyPosition();                                                      //动作分离版本改变
            Vector3 middle_pos = new Vector3(end_pos.x, role.getGameObject().transform.position.y, end_pos.z); //动作分离版本改变
            actionManager.moveRole(role.getGameObject(), middle_pos, end_pos, role.move_speed);                //动作分离版本改变

            role.GoBoat(boat);
            boat.AddRole(role);
        }
        user_gui.sign = Check();

        /*if (user_gui.sign == 1)
         * {
         *  for (int i = 0; i < 3; i++)
         *  {
         *      roles[i].PlayGameOver();
         *      roles[i + 3].PlayGameOver();
         *  }
         * }*///f**k
    }
예제 #5
0
 public void MoveRole(RoleModel role)    //移动角色
 {
     if (user_gui.sign != 0)
     {
         return;
     }
     if (role.IsOnBoat())
     {
         LandModel land;
         if (boat.GetBoatSign() == -1)
         {
             land = end_land;
         }
         else
         {
             land = start_land;
         }
         boat.DeleteRoleByName(role.GetName());
         role.Move(land.GetEmptyPosition());
         role.GoLand(land);
         land.AddRole(role);
     }
     else
     {
         LandModel land = role.GetLandModel();
         if (boat.GetEmptyNumber() == -1 || land.GetLandSign() != boat.GetBoatSign())
         {
             return;                                                                            //船没有空位,也不是船停靠的陆地,就不上船
         }
         land.DeleteRoleByName(role.GetName());
         role.Move(boat.GetEmptyPosition());
         role.GoBoat(boat);
         boat.AddRole(role);
     }
     user_gui.sign = Check();
     if (user_gui.sign == 1)
     {
         for (int i = 0; i < 3; i++)
         {
             // roles[i].PlayGameOver();
             // roles[i + 3].PlayGameOver();
         }
     }
 }
예제 #6
0
 public void MoveRole(RoleModel r)
 {
     if (gui.sign != 0)
     {
         return;
     }
     if (r.IsOnBoat())
     {
         LandModel land;
         if (boat.GetBoatSign() == -1)
         {
             land = end_land;
         }
         else
         {
             land = start_land;
         }
         boat.DeleteRoleByName(r.GetName());
         //r.Move(land.GetEmptyPosition());
         manager.moveRole(r.GetGameObject(), new Vector3(r.GetGameObject().transform.position.x, land.GetEmptyPosition().y, land.GetEmptyPosition().z), land.GetEmptyPosition(), r.speed);
         r.GoLand(land);
         land.AddRole(r);
     }
     else
     {
         LandModel land = r.GetLandModel();
         if (boat.GetEmptyNumber() == -1 || land.GetLandSign() != boat.GetBoatSign())
         {
             return;
         }
         land.DeleteRoleByName(r.GetName());
         //r.Move(boat.GetEmptyPosition());
         manager.moveRole(r.GetGameObject(), new Vector3(boat.GetEmptyPosition().x, r.GetGameObject().transform.position.y, boat.GetEmptyPosition().z), boat.GetEmptyPosition(), r.speed);
         r.GoBoat(boat);
         boat.AddRole(r);
     }
     gui.sign = judge.Check();
 }