コード例 #1
0
    void SnapPlayer()
    {
        CharacterMotor.SetCanMove(false);
        CharacterInputController.SetCanTurn(false);
        CharacterInputController.ToggleToolsInput(false);
        canPerformAction = true;

        switch (currentActivity)
        {
        case LoggingActivity.FELLING:
            CharacterInputController.InitiateLoggingState(AnimState.IDLE_FELLING);
            break;

        case LoggingActivity.BUCKING:
            CharacterInputController.InitiateLoggingState(AnimState.IDLE_BUCKING);
            break;

        case LoggingActivity.SPLITTING:
            CharacterInputController.InitiateLoggingState(AnimState.IDLE_SPLITTING);
            break;
        }
        transform.position = snapLocation.position;
        transform.rotation = snapLocation.rotation;

        GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezeAll;

        playerIsLocked = true;
    }
コード例 #2
0
    public static void UnsnapPlayer()
    {
        PlayerHud.ToggleQualityGame(false);

        CharacterMotor.SetCanMove(true);
        CharacterInputController.SetCanTurn(true);
        CharacterInputController.InitiateLoggingState(AnimState.NONE);
        CharacterInputController.ToggleToolsInput(true);
        CharacterAnimator.ResetLoggingTriggers();

        Instance.GetComponent <Rigidbody>().constraints = startingConstraints;

        playerIsLocked = false;
    }