示例#1
0
文件: Ouros.cs 项目: xrofng/Blasphemy
    void CameraMovement()
    {
        Vector3 camAbocve = new Vector3(transform.position.x, transform.position.y + 2.5f, transform.position.z);

        switch (cameraMovementType)
        {
        case CameraMovementType.Lerp:
            cameraHolder.transform.position = Vector3.Lerp(cameraHolder.transform.position, transform.position, Time.deltaTime * CameraSpeed);
            break;

        case CameraMovementType.MoveTowards:
            cameraHolder.transform.position = Vector3.MoveTowards(cameraHolder.transform.position, transform.position, Time.deltaTime * CameraSpeed);
            break;

        case CameraMovementType.AccelDecel:
            cameraHolder.transform.position = Interpolation.AccelDecelInterpolation(cameraHolder.position, camAbocve, Time.deltaTime * CameraSpeed);
            break;

        case CameraMovementType.Acceleration:
            cameraHolder.transform.position = Interpolation.AccelerationInterpolation(cameraHolder.position, camAbocve, Time.deltaTime * CameraSpeed, 1);
            break;
        }
    }