Exemplo n.º 1
0
    private void MoveClumsy(float time)
    {
        const float manualCaveScale = 0.8558578f;
        float       distToTravel    = Toolbox.TileSizeX * manualCaveScale + 1f;

        if (ThePlayer.IsPerched())
        {
            return;
        }
        float dist = time * ThePlayer.GetPlayerSpeed();

        if (_distTravelled + dist > distToTravel)
        {
            dist = distToTravel - _distTravelled;
            ThePlayer.SetMovementMode(FlapComponent.MovementMode.HorizontalEnabled);
            StartCoroutine("BossEntrance");
        }
        _distTravelled += dist;
        ThePlayer.transform.position         += Vector3.right * dist;
        _playerCam.transform.position        += Vector3.right * dist;
        ThePlayer.Lantern.transform.position += Vector3.right * dist;
    }