示例#1
0
    private void RemovePlayerFromFerry(IslandController island)
    {
        state = PlayerFerryState.None;
        var onFerry = OnFerry;

        if (onFerry)
        {
            player.transform.SetParent(null);
            player.transform.position = island.DockingArea.DockPosition;
        }

        player.Island = island ?? gameManager.Islands.FindPlayerIsland(player);

        player.Unlock();
        if (player.Chunk != null)
        {
            player.GotoClosest(player.Chunk.ChunkType);
        }

        if (onFerry)
        {
            gameManager.Server?.Client?.SendCommand(
                player.PlayerName,
                "ferry_success",
                $"You have disembarked the ferry.");
        }
    }
示例#2
0
    private void AddPlayerToFerry()
    {
        var ferryPoint = ferry.GetNextPlayerPoint();

        if (ferryPoint)
        {
            state = PlayerFerryState.Embarked;
            player.transform.SetParent(ferryPoint);
            player.transform.localPosition = Vector3.zero;
            player.transform.rotation      = ferryPoint.rotation;
            player.Island = null;
        }
    }
示例#3
0
 public void Disembark(IslandController destination = null)
 {
     state            = PlayerFerryState.Disembarking;
     this.destination = destination;
 }
示例#4
0
 public void Embark(IslandController destination = null)
 {
     player.Animations.ResetAnimationStates();
     state            = PlayerFerryState.Embarking;
     this.destination = destination;
 }