コード例 #1
0
    private void CheckKey()
    {
        if (Time.timeScale != 0)
        {
            if (GetWithEnemyState() == "")
            {
                if (ThisCharaGeneral != null)
                {
                    if (Input.GetKey(KeyCode.LeftArrow) & Input.GetKey(KeyCode.UpArrow))
                    {
                        ThisCharaGeneral.AddPosition(MoveAmountOneKey * MoveDiagonal * -1, MoveAmountOneKey * MoveDiagonal);
                        ThisCharaGeneral.AddDirection(MoveAmountOneKey * MoveDiagonal * -1, MoveAmountOneKey * MoveDiagonal);
                        SetMoveNow(-1f, 1f);
                    }
                    else if (Input.GetKey(KeyCode.RightArrow) & Input.GetKey(KeyCode.UpArrow))
                    {
                        ThisCharaGeneral.AddPosition(MoveAmountOneKey * MoveDiagonal, MoveAmountOneKey * MoveDiagonal);
                        ThisCharaGeneral.AddDirection(MoveAmountOneKey * MoveDiagonal, MoveAmountOneKey * MoveDiagonal);
                        SetMoveNow(1f, 1f);
                    }
                    else if (Input.GetKey(KeyCode.LeftArrow) & Input.GetKey(KeyCode.DownArrow))
                    {
                        ThisCharaGeneral.AddPosition(MoveAmountOneKey * MoveDiagonal * -1, MoveAmountOneKey * MoveDiagonal * -1);
                        ThisCharaGeneral.AddDirection(MoveAmountOneKey * MoveDiagonal * -1, MoveAmountOneKey * MoveDiagonal * -1);
                        SetMoveNow(-1f, -1f);
                    }
                    else if (Input.GetKey(KeyCode.RightArrow) & Input.GetKey(KeyCode.DownArrow))
                    {
                        ThisCharaGeneral.AddPosition(MoveAmountOneKey * MoveDiagonal, MoveAmountOneKey * MoveDiagonal * -1);
                        ThisCharaGeneral.AddDirection(MoveAmountOneKey * MoveDiagonal, MoveAmountOneKey * MoveDiagonal * -1);
                        SetMoveNow(1f, -1f);
                    }
                    else if (Input.GetKey(KeyCode.LeftArrow))
                    {
                        ThisCharaGeneral.AddPosition(MoveAmountOneKey * -1, 0);
                        ThisCharaGeneral.AddDirection(MoveAmountOneKey * -1, 0);
                        SetMoveNow(-1f, 0);
                    }
                    else if (Input.GetKey(KeyCode.RightArrow))
                    {
                        ThisCharaGeneral.AddPosition(MoveAmountOneKey, 0);
                        ThisCharaGeneral.AddDirection(MoveAmountOneKey, 0);
                        SetMoveNow(1f, 0);
                    }
                    else if (Input.GetKey(KeyCode.UpArrow))
                    {
                        ThisCharaGeneral.AddPosition(0, MoveAmountOneKey);
                        ThisCharaGeneral.AddDirection(0, MoveAmountOneKey);
                        SetMoveNow(0, 1f);
                    }
                    else if (Input.GetKey(KeyCode.DownArrow))
                    {
                        ThisCharaGeneral.AddPosition(0, MoveAmountOneKey * -1);
                        ThisCharaGeneral.AddDirection(0, MoveAmountOneKey * -1);
                        SetMoveNow(0, -1f);
                    }
                    else if (Input.GetKey(KeyCode.DownArrow) == false & Input.GetKey(KeyCode.UpArrow) == false & Input.GetKey(KeyCode.RightArrow) == false & Input.GetKey(KeyCode.LeftArrow) == false)
                    {
                        SetMoveNow(0, 0);
                    }
                    else
                    {
                    }
                }
                if (Input.GetKeyDown(KeyCode.Z))
                {
                    ThisAttack.EquipWeapon(0, "Check");

                    ThisAttack.AttackSimpleMake(0);
                }

                if (Input.GetKeyDown(KeyCode.A))
                {
                    ThisAttack.EquipWeapon(1, "GunBullet");

                    ThisAttack.AttackSimpleMake(1);
                }
                if (Input.GetKeyDown(KeyCode.S))
                {
                    ThisAttack.EquipWeapon(2, "Shield");
                    ThisAttack.AttackSimpleMake(2);
                }
                if (Input.GetKeyDown(KeyCode.P))
                {
                }
            }
            else if (GetWithEnemyState() == "Holding" | GetWithEnemyState() == "Dizzying" | GetWithEnemyState() == "Voreing")
            {
                if (Input.GetKeyDown(KeyCode.LeftArrow) | Input.GetKeyDown(KeyCode.UpArrow) | Input.GetKeyDown(KeyCode.RightArrow) | Input.GetKeyDown(KeyCode.DownArrow))
                {
                    AddGachaPoint(5);
                }
            }
        }
    }
コード例 #2
0
    private void CheckKey()
    {
        if (Time.timeScale != 0)
        {
            if (ThisCharaGeneral != null)
            {
                if (Input.GetKey(KeyCode.Keypad4) & Input.GetKey(KeyCode.Keypad8))
                {
                    ThisCharaGeneral.AddPosition(MoveAmountOneKey * MoveDiagonal * -1, MoveAmountOneKey * MoveDiagonal);
                    ThisCharaGeneral.AddDirection(MoveAmountOneKey * MoveDiagonal * -1, MoveAmountOneKey * MoveDiagonal);
                    SetMoveNow(-1f, 1f);
                }
                else if (Input.GetKey(KeyCode.Keypad6) & Input.GetKey(KeyCode.Keypad8))
                {
                    ThisCharaGeneral.AddPosition(MoveAmountOneKey * MoveDiagonal, MoveAmountOneKey * MoveDiagonal);
                    ThisCharaGeneral.AddDirection(MoveAmountOneKey * MoveDiagonal, MoveAmountOneKey * MoveDiagonal);
                    SetMoveNow(1f, 1f);
                }
                else if (Input.GetKey(KeyCode.Keypad4) & Input.GetKey(KeyCode.Keypad2))
                {
                    ThisCharaGeneral.AddPosition(MoveAmountOneKey * MoveDiagonal * -1, MoveAmountOneKey * MoveDiagonal * -1);
                    ThisCharaGeneral.AddDirection(MoveAmountOneKey * MoveDiagonal * -1, MoveAmountOneKey * MoveDiagonal * -1);
                    SetMoveNow(-1f, -1f);
                }
                else if (Input.GetKey(KeyCode.Keypad6) & Input.GetKey(KeyCode.Keypad2))
                {
                    ThisCharaGeneral.AddPosition(MoveAmountOneKey * MoveDiagonal, MoveAmountOneKey * MoveDiagonal * -1);
                    ThisCharaGeneral.AddDirection(MoveAmountOneKey * MoveDiagonal, MoveAmountOneKey * MoveDiagonal * -1);
                    SetMoveNow(1f, -1f);
                }
                else if (Input.GetKey(KeyCode.Keypad4))
                {
                    ThisCharaGeneral.AddPosition(MoveAmountOneKey * -1, 0);
                    ThisCharaGeneral.AddDirection(MoveAmountOneKey * -1, 0);
                    SetMoveNow(-1f, 0);
                }
                else if (Input.GetKey(KeyCode.Keypad6))
                {
                    ThisCharaGeneral.AddPosition(MoveAmountOneKey, 0);
                    ThisCharaGeneral.AddDirection(MoveAmountOneKey, 0);
                    SetMoveNow(1f, 0);
                }
                else if (Input.GetKey(KeyCode.Keypad8))
                {
                    ThisCharaGeneral.AddPosition(0, MoveAmountOneKey);
                    ThisCharaGeneral.AddDirection(0, MoveAmountOneKey);
                    SetMoveNow(0, 1f);
                }
                else if (Input.GetKey(KeyCode.Keypad2))
                {
                    ThisCharaGeneral.AddPosition(0, MoveAmountOneKey * -1);
                    ThisCharaGeneral.AddDirection(0, MoveAmountOneKey * -1);
                    SetMoveNow(0, -1f);
                }
                else if (Input.GetKey(KeyCode.Keypad2) == false & Input.GetKey(KeyCode.Keypad4) == false & Input.GetKey(KeyCode.Keypad6) == false & Input.GetKey(KeyCode.Keypad8) == false)
                {
                    SetMoveNow(0, 0);
                }

                if (Input.GetKeyDown(KeyCode.Q))
                {
                    AttackSearchRush();
                }
                if (Input.GetKeyDown(KeyCode.W))
                {
                    AttackHold();
                }
                if (Input.GetKeyDown(KeyCode.E))
                {
                    ThisAttack.EquipWeapon(0, "GunBullet");
                    ThisAttack.AttackSimpleMake(0);
                }
            }
        }
    }