Ejemplo n.º 1
0
 void Start()
 {
     m_PlayerStance = GetComponent <PlayerStance>();
     AetherInput.GetPlayerActions().UseSkill.performed += UseSkillAt;
     AetherInput.GetPlayerActions().SwitchSkills.performed += SwitchSkills;
     m_ItemSkillSlots = new Queue <SkillItem>();
 }
Ejemplo n.º 2
0
 void Start()
 {
     AetherInput.GetPlayerActions().Jump.performed += JumpInputCallback;
     AetherInput.GetPlayerActions().Dodge.performed += DodgeInputCallback;
     m_CharacterController = GetComponent <CharacterController>();
     m_PlayerStance        = GetComponent <PlayerStance>();
     m_PlayerCombatHandler = GetComponent <PlayerCombatHandler>();
 }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        Vector2 mouseInput = AetherInput.GetPlayerActions().Look.ReadValue <Vector2>();
        float   mouseX     = mouseInput.x * m_MouseSensitivity * Time.deltaTime;
        float   mouseY     = mouseInput.y * m_MouseSensitivity * Time.deltaTime;

        m_xRot -= mouseY;
        m_xRot  = Mathf.Clamp(m_xRot, -90, 90);

        transform.localRotation = Quaternion.Euler(m_xRot, 0, 0);
        m_Player.Rotate(Vector3.up, mouseX);
    }
Ejemplo n.º 4
0
    private void HandleMovement()
    {
        m_LastKnownInput = AetherInput.GetPlayerActions().Move.ReadValue <Vector2>();
        Vector3 move = Camera.main.transform.right * m_LastKnownInput.x + Camera.main.transform.forward * m_LastKnownInput.y;

        move *= Time.deltaTime * m_MoveSpeed;

        // Slow the player down after a fall
        if (IsRecoveringFromFall())
        {
            float mod = (Time.time - m_LandingTime) / m_LandingRecoveryTime;
            move *= Mathf.Lerp(m_LandingSpeedModifier, 1, mod);
        }

        m_Velocity = new Vector3(move.x, m_Velocity.y, move.z);
    }
Ejemplo n.º 5
0
    private void BlockIfPossible()
    {
        if (m_PlayerStance == null)
        {
            return;
        }

        m_BlockedInCurrentFrame = false;

        if (!m_PlayerStance.IsCombatStance())
        {
            return;
        }

        if (!m_PlayerStance.CanPerformAction(PlayerStance.Action.ACTION_BLOCK))
        {
            return;
        }

        m_BlockedInCurrentFrame = AetherInput.GetPlayerActions().Block.ReadValue <float>() != 0;
    }
Ejemplo n.º 6
0
 private void Start()
 {
     // For test purpose
     AetherInput.GetPlayerActions().Fire.performed += HandleLaunchMeteor;
 }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     m_PlayerStance = GetComponent <PlayerStance>();
     AetherInput.GetPlayerActions().Fire.performed += AttackInputCallback;
     AetherInput.GetPlayerActions().Sheathe.performed += SheatheInputCallback;
 }
Ejemplo n.º 8
0
 void Start()
 {
     AetherInput.GetPlayerActions().Jump.performed += HandleJump;
     m_CharacterController = GetComponent <CharacterController>();
 }
Ejemplo n.º 9
0
    public float GetAxisCustom(string axisName)
    {
        Vector2 lookDelta = AetherInput.GetPlayerActions().Look.ReadValue <Vector2>();

        return(axisName == "Mouse X" ? lookDelta.x : lookDelta.y);
    }
Ejemplo n.º 10
0
 public Vector2 GetInputAxis()
 {
     return(AetherInput.GetPlayerActions().Move.ReadValue <Vector2>());
 }