public bool GetKey(KeyMode km, Key_Hub key)
    {
        if (!gameObject.activeSelf)
        {
            return(false);
        }

        bool flag = false;

        switch (km)
        {
        case KeyMode.Enter:
        {
            flag = GetEnter(key, hard);
        }
        break;

        case KeyMode.Stay:
        {
            flag = GetStay(key, hard);
        }
        break;

        case KeyMode.Exit:
        {
            flag = GetExit(key, hard);
        }
        break;
        }

        return(flag);
    }
    bool SwitchConvert(Key_Hub k, ref Joycon.Button button, ref bool isLeft)
    {
        button = Joycon.Button.HOME;
        isLeft = false;
        switch (k)
        {
        case Key_Hub.U: { button = Joycon.Button.DPAD_UP; isLeft = true; } break;

        case Key_Hub.R: { button = Joycon.Button.DPAD_RIGHT; isLeft = true; } break;

        case Key_Hub.D: { button = Joycon.Button.DPAD_DOWN; isLeft = true; } break;

        case Key_Hub.L: { button = Joycon.Button.DPAD_LEFT; isLeft = true; } break;

        case Key_Hub.X: { button = Joycon.Button.DPAD_UP; isLeft = false; } break;

        case Key_Hub.A: { button = Joycon.Button.DPAD_RIGHT; isLeft = false; } break;

        case Key_Hub.B: { button = Joycon.Button.DPAD_DOWN; isLeft = false; } break;

        case Key_Hub.Y: { button = Joycon.Button.DPAD_LEFT; isLeft = false; } break;

        case Key_Hub.L1: { button = Joycon.Button.SHOULDER_1; isLeft = true; } break;

        case Key_Hub.L2: { button = Joycon.Button.SHOULDER_2; isLeft = true; } break;

        case Key_Hub.L3: { button = Joycon.Button.STICK; isLeft = true; } break;

        case Key_Hub.R1: { button = Joycon.Button.SHOULDER_1; isLeft = false; } break;

        case Key_Hub.R2: { button = Joycon.Button.SHOULDER_2; isLeft = false; } break;

        case Key_Hub.R3: { button = Joycon.Button.STICK; isLeft = false; } break;

        case Key_Hub.Option: { button = Joycon.Button.PLUS; isLeft = false; } break;

        case Key_Hub.Select: { button = Joycon.Button.MINUS; isLeft = true; } break;

        case Key_Hub.Home: { button = Joycon.Button.HOME; isLeft = false; } break;

        case Key_Hub.Share: { button = Joycon.Button.CAPTURE; isLeft = true; } break;

        default: { return(false); }
        }
        return(true);
    }
    bool GetExit(Key_Hub k, HardMode h)
    {
        if (!gameObject.activeSelf)
        {
            return(false);
        }

        bool flag = false;

        switch (h)
        {
        case HardMode.PS4: { flag = Exit_PS4(k); } break;

        case HardMode.PC: { flag = Exit_PC(k); } break;
        }

        return(flag);
    }
    bool Enter_PS4(Key_Hub k)
    {
        switch (k)
        {
        case Key_Hub.U: { return(KM_PS.enterUP); }

        case Key_Hub.R: { return(KM_PS.enterRIGHT); }

        case Key_Hub.D: { return(KM_PS.enterDOWN); }

        case Key_Hub.L: { return(KM_PS.enterLEFT); }

        case Key_Hub.X: { return(KM_PS.enterSANKAKU); }

        case Key_Hub.A: { return(KM_PS.enterMARU); }

        case Key_Hub.B: { return(KM_PS.enterBATU); }

        case Key_Hub.Y: { return(KM_PS.enterSIKAKU); }

        case Key_Hub.L1: { return(KM_PS.enterL1); }

        case Key_Hub.L2: { return(KM_PS.enterL2); }

        case Key_Hub.L3: { return(KM_PS.enterL3); }

        case Key_Hub.R1: { return(KM_PS.enterR1); }

        case Key_Hub.R2: { return(KM_PS.enterR2); }

        case Key_Hub.R3: { return(KM_PS.enterR3); }

        case Key_Hub.Option: { return(KM_PS.enterOPTION); }

        case Key_Hub.Select: { return(KM_PS.enterPAD); }

        case Key_Hub.Home: { return(KM_PS.enterPS); }

        case Key_Hub.Share: { return(KM_PS.enterSHARE); }
        }
        return(false);
    }
    bool Exit_PS4(Key_Hub k)
    {
        switch (k)
        {
        case Key_Hub.U: { return(KM_PS.exitUP); }

        case Key_Hub.R: { return(KM_PS.exitRIGHT); }

        case Key_Hub.D: { return(KM_PS.exitDOWN); }

        case Key_Hub.L: { return(KM_PS.exitLEFT); }

        case Key_Hub.X: { return(KM_PS.exitSANKAKU); }

        case Key_Hub.A: { return(KM_PS.exitMARU); }

        case Key_Hub.B: { return(KM_PS.exitBATU); }

        case Key_Hub.Y: { return(KM_PS.exitSIKAKU); }

        case Key_Hub.L1: { return(KM_PS.exitL1); }

        case Key_Hub.L2: { return(KM_PS.exitL2); }

        case Key_Hub.L3: { return(KM_PS.exitL3); }

        case Key_Hub.R1: { return(KM_PS.exitR1); }

        case Key_Hub.R2: { return(KM_PS.exitR2); }

        case Key_Hub.R3: { return(KM_PS.exitR3); }

        case Key_Hub.Option: { return(KM_PS.exitOPTION); }

        case Key_Hub.Select: { return(KM_PS.exitPAD); }

        case Key_Hub.Home: { return(KM_PS.exitPS); }

        case Key_Hub.Share: { return(KM_PS.exitSHARE); }
        }
        return(false);
    }
    bool Stay_PS4(Key_Hub k)
    {
        switch (k)
        {
        case Key_Hub.U: { return(KM_PS.stayUP); }

        case Key_Hub.R: { return(KM_PS.stayRIGHT); }

        case Key_Hub.D: { return(KM_PS.stayDOWN); }

        case Key_Hub.L: { return(KM_PS.stayLEFT); }

        case Key_Hub.X: { return(KM_PS.staySANKAKU); }

        case Key_Hub.A: { return(KM_PS.stayMARU); }

        case Key_Hub.B: { return(KM_PS.stayBATU); }

        case Key_Hub.Y: { return(KM_PS.staySIKAKU); }

        case Key_Hub.L1: { return(KM_PS.stayL1); }

        case Key_Hub.L2: { return(KM_PS.stayL2); }

        case Key_Hub.L3: { return(KM_PS.stayL3); }

        case Key_Hub.R1: { return(KM_PS.stayR1); }

        case Key_Hub.R2: { return(KM_PS.stayR2); }

        case Key_Hub.R3: { return(KM_PS.stayR3); }

        case Key_Hub.Option: { return(KM_PS.stayOPTION); }

        case Key_Hub.Select: { return(KM_PS.stayPAD); }

        case Key_Hub.Home: { return(KM_PS.stayPS); }

        case Key_Hub.Share: { return(KM_PS.staySHARE); }
        }
        return(false);
    }
    bool Exit_PC(Key_Hub k)
    {
        switch (k)
        {
        case Key_Hub.U: { return(Input.GetKeyUp(KeyCode.Alpha1)); }

        case Key_Hub.R: { return(Input.GetKeyUp(KeyCode.Alpha2)); }

        case Key_Hub.D: { return(Input.GetKeyUp(KeyCode.Alpha3)); }

        case Key_Hub.L: { return(Input.GetKeyUp(KeyCode.Alpha4)); }

        case Key_Hub.X: { return(Input.GetMouseButtonUp(1)); }

        case Key_Hub.A: { return(Input.GetMouseButtonUp(0)); }

        case Key_Hub.B: { return(Input.GetKeyUp(KeyCode.Space)); }

        case Key_Hub.Option: { return(Input.GetKeyUp(KeyCode.Escape)); }

        case Key_Hub.L3: { return(Input.GetMouseButtonUp(2)); }
        }
        return(false);
    }
    public bool LRRevFlag = false;//⇔スティックを入れ替え


    public string GetKey_HubImage(Key_Hub keyHubName)
    {
        return(Enum.GetName(typeof(Key_Hub), keyHubName));
    }