예제 #1
0
    // Use this for initialization
    void Start()
    {
        _locomotionBehaviors = LocomotionController.GetComponents <MonoBehaviour>();

        AddLabel("Input Handler");
        _toggleAvatarTouch = SetupToggle <TeleportInputHandler, TeleportInputHandlerAvatarTouch>("Avatar Touch");
        _toggleGenericHMD  = SetupToggle <TeleportInputHandler, TeleportInputHandlerHMD>("Generic HMD");

        AddLabel("Aim Handler");
        _toggleLaser     = SetupToggle <TeleportAimHandler, TeleportAimHandlerLaser>("Laser");
        _toggleParabolic = SetupToggle <TeleportAimHandler, TeleportAimHandlerParabolic>("Parabolic");

        AddLabel("Target Handler");
        _toggleNavMesh      = SetupToggle <TeleportTargetHandler, TeleportTargetHandlerNavMesh>("Nav Mesh");
        _toggleTeleportNode = SetupToggle <TeleportTargetHandler, TeleportTargetHandlerNode>("Teleport Node");
        _toggleGeometry     = SetupToggle <TeleportTargetHandler, TeleportTargetHandlerPhysical>("Geometry");

        AddLabel("Orientation Handler");
        _toggle360 = SetupToggle <TeleportOrientationHandler, TeleportOrientationHandler360>("360");
        _toggleHMD = SetupToggle <TeleportOrientationHandler, TeleportOrientationHandlerHMD>("HMD");
        _toggleThumbstickRelative = SetupToggle <TeleportOrientationHandler, TeleportOrientationHandlerThumbstick>("Thumbstick Head Relative", TeleportOrientationHandler.OrientationModes.HeadRelative);
        _toggleThumbstickForward  = SetupToggle <TeleportOrientationHandler, TeleportOrientationHandlerThumbstick>("Thumbstick Forward Facing", TeleportOrientationHandler.OrientationModes.ForwardFacing);

        AddLabel("Transition");
        _toggleInstant = SetupToggle <TeleportTransition, TeleportTransitionInstant>("Instant");
        _toggleBlink   = SetupToggle <TeleportTransition, TeleportTransitionBlink>("Blink");
        _toggleWarp    = SetupToggle <TeleportTransition, TeleportTransitionWarp>("Warp (no orientation)");

        AddLabel("Enable Linear Motion During Teleport States");
        _teleportController             = LocomotionController.GetComponent <LocomotionTeleport>();
        _toggleLinearMotionReady        = SetupToggle("Ready State Motion", ToggleReadyStateMotion);
        _toggleLinearMotionAim          = SetupToggle("Aim State Motion", ToggleAimStateMotion);
        _toggleLinearMotionPreTeleport  = SetupToggle("PreTeleport State Motion", TogglePreTeleportStateMotion);
        _toggleLinearMotionPostTeleport = SetupToggle("PostTeleport State Motion", TogglePostTeleportStateMotion);

        AddLabel("Enable Rotation During Teleport States");
        _teleportController         = LocomotionController.GetComponent <LocomotionTeleport>();
        _toggleRotationReady        = SetupToggle("Ready State Rotation", ToggleReadyStateRotation);
        _toggleRotationAim          = SetupToggle("Aim State Rotation", ToggleAimStateRotation);
        _toggleRotationPreTeleport  = SetupToggle("PreTeleport State Rotation", TogglePreTeleportStateRotation);
        _toggleRotationPostTeleport = SetupToggle("PostTeleport State Rotation", TogglePostTeleportStateRotation);

        ToggleTemplate.SetActive(false);
        LabelTemplate.SetActive(false);
    }