docs.unity3d.com
    显示 / 隐藏目录

    Class CameraFPSModeHandler

    Input handler for movement in the device view and game view when using SimulatedCameraProvider.

    Inheritance
    Object
    CameraFPSModeHandler
    Namespace: Unity.MARS
    Syntax
    public class CameraFPSModeHandler

    Fields

    activeHandler

    The active camera fps mode handler.

    Declaration
    public static CameraFPSModeHandler activeHandler
    Field Value
    Type Description
    CameraFPSModeHandler

    Properties

    MoveActive

    Is there active movement.

    Declaration
    public bool MoveActive { get; }
    Property Value
    Type Description
    Boolean

    MovementBounds

    The bounds of the movement area.

    Declaration
    public Bounds MovementBounds { get; set; }
    Property Value
    Type Description
    Bounds

    UseMovementBounds

    Use MovementBounds bounds to restrict movement.

    Declaration
    public bool UseMovementBounds { get; set; }
    Property Value
    Type Description
    Boolean

    Methods

    CalculateMovement(Pose, Boolean)

    Calculate the new pose for the camera based on the fps mode movement.

    Declaration
    public Pose CalculateMovement(Pose pose, bool invertY = false)
    Parameters
    Type Name Description
    Pose pose

    Current Pose of the transform we are going to move.

    Boolean invertY

    Invert the Y axis of the mouse position.

    Returns
    Type Description
    Pose

    HandleGameInput()

    Handle the FPS mode movement from a game view.

    Declaration
    public void HandleGameInput()

    HandleGUIInput(Rect, Event, EventType, Vector2)

    Handle the fps movement input in the given rect.

    Declaration
    public void HandleGUIInput(Rect rect, Event currentEvent, EventType type, Vector2 eventDelta = default(Vector2))
    Parameters
    Type Name Description
    Rect rect

    The rect the the input handling is masked to.

    Event currentEvent

    Current unity event to process.

    EventType type

    The event type, cached from the beginning of OnGUI

    Vector2 eventDelta

    Mouse delta from current event, cached at the beginning of OnGUI

    StopMoveInput(Vector2)

    End all movement.

    Declaration
    public void StopMoveInput(Vector2 mousePosition)
    Parameters
    Type Name Description
    Vector2 mousePosition

    The current mose position.

    返回到顶部
    Copyright © 2023 Unity Technologies — 商标和使用条款
    • 法律条款
    • 隐私政策
    • Cookie
    • 不要出售或分享我的个人信息
    • Your Privacy Choices (Cookie Settings)