Exemple #1
0
    private void Awake()
    {
        controller = GetComponent <CharacterController>();
        player     = GetComponent <Player>();
        jump       = GetComponent <JumpPlayer>();
        attack     = GetComponent <MainAttackPlayer>();

        touchControl             = FindObjectOfType <TouchControl>();
        playerInputConfiguration = GetComponent <PlayerInputConfiguration>();

        maxMoveSpeed = moveSpeed;

        InitializeInput();

        camTransform = Camera.main.transform;
    }
Exemple #2
0
    void Awake()
    {
        controller               = GetComponent <CharacterController>();
        player                   = GetComponent <Player>();
        attack                   = GetComponent <MainAttackPlayer>();
        touchControl             = GameObject.FindObjectOfType <TouchControl>();
        playerInputConfiguration = GetComponent <PlayerInputConfiguration>();


        InitializeInput();


        slopeLimit     = controller.slopeLimit;
        jumpSlopeLimit = Mathf.Clamp(controller.slopeLimit * 2, 0f, 90f);

        maxJumpCount = jumpCount;
    }