예제 #1
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = FindObjectOfType <PlayerKeyMaster>();

            if (instance == null)
            {
                GameObject container = new GameObject("PlayerKeyMaster");

                instance = container.AddComponent <PlayerKeyMaster>();
            }
        }
    }
예제 #2
0
    void Jump() // 점프
    {
        if (Input.GetKeyDown(PlayerKeyMaster.GetInstance().keyMaster[PlayerKey.Jump]))
        {
            rigidbody.velocity = new Vector3(0, state.jumpForce, 0);
            GetComponent <BoxCollider2D>().isTrigger = true;
            anim.SetBool("Jump", true);

            if (!attack.jumpAttackCheck)
            {
                attack.jumpAttackCheck = true;
            }
        }
    }
예제 #3
0
    void DoubleJump() // 더블점프
    {
        if (Input.GetKeyDown(PlayerKeyMaster.GetInstance().keyMaster[PlayerKey.Jump]))
        {
            anim.SetBool("DoubleJump", true);
            anim.Play("DoubleJump");
            rigidbody.velocity = new Vector3(0, state.jumpForce, 0);
            doubleJump         = false;

            if (!attack.jumpAttackCheck)
            {
                attack.jumpAttackCheck = true;
            }
        }
    }
예제 #4
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown((PlayerKeyMaster.GetInstance().keyMaster[PlayerKey.Attack])))
     {
         if (_manager.move.groundChack) // 지상
         {
             if (Input.GetKey((PlayerKeyMaster.GetInstance().keyMaster[PlayerKey.UpperCut])))
             {
                 _manager.ChScript(Player_State.UpperCut);
                 return;
             }
             attackGround.GroundAttackCheck();
         }
         else if (!_manager.move.groundChack) //공중
         {
             attackJump.JumpAttackCheck();
         }
     }
 }
예제 #5
0
    // Update is called once per frame
    void Update()
    {
        NotGavity();
        if (_manager.anim.GetInteger("Fsm") != (int)Player_State.Damaged && _manager.anim.GetInteger("Fsm") != 99)
        {
            if (Input.GetKeyDown(PlayerKeyMaster.GetInstance().keyMaster[PlayerKey.Attack]))
            {
                if (Input.GetKey(PlayerKeyMaster.GetInstance().keyMaster[PlayerKey.UpperCut]) && _manager.move.groundChack)
                {
                    _manager.ChScript(Player_State.UpperCut);
                }
                else
                {
                    _manager.ChScript(Player_State.Attack);
                }
            }

            if (Input.GetKey(PlayerKeyMaster.GetInstance().keyMaster[PlayerKey.Healing]) && _manager.move.groundChack)
            {
                _manager.ChScript(Player_State.Healing);
            }
        }
    }
예제 #6
0
    private void Update()
    {
        if (state.hp.value <= 0)
        {
            ChScript(Player_State.Death);
        }

        if (!anim.GetCurrentAnimatorStateInfo(0).IsName("Skill") && _CurrentState != Player_State.Damaged)
        {
            if (Input.GetKeyDown(PlayerKeyMaster.GetInstance().keyMaster[PlayerKey.Skill]) && state.skillCount > 0) // 일썸
            {
                ChScript(Player_State.Skill);
            }
        }

        if (Input.GetKeyDown(KeyCode.Q))
        {
            ChScript(Player_State.Damaged);
        }
        else if (Input.GetKeyDown(KeyCode.W))
        {
            ChScript(Player_State.Death);
        }
    }