コード例 #1
0
ファイル: OptionMenuItem.cs プロジェクト: mliuzailin/GitGame
    public OptionMenuItem setup(OptionMenu.ItemType _type, string _title, string _message, bool bSwitch)
    {
        SetSwitch(bSwitch);
        m_Type  = _type;
        Title   = _title;
        Message = _message;

        return(this);
    }
コード例 #2
0
    public void OnSelect(OptionMenu.ItemType _type)
    {
        OptionMenuItem selectItem = m_OptionMenu.GetOptionItem(_type);

        switch (_type)
        {
        case OptionMenu.ItemType.NOTIFICATION:
        {
            bool isSwitch = m_OptionMenu.GetOptionItem(_type).IsSwitch();

            m_OptionMenu.GetOptionItem(OptionMenu.ItemType.NOT_EVENT).SetSwitch(isSwitch);         // イベント通知設定を変更
            m_OptionMenu.GetOptionItem(OptionMenu.ItemType.NOT_STAMINA).SetSwitch(isSwitch);       // スタミナ通知設定を変更
        }
        break;

        case OptionMenu.ItemType.NOT_EVENT:
        case OptionMenu.ItemType.NOT_STAMINA:
        {
            if (m_OptionMenu.GetOptionItem(_type).IsSwitch() == true)
            {
                // 通知設定がONになった場合は、アプリケーションの通知設定もONにする
                m_OptionMenu.GetOptionItem(OptionMenu.ItemType.NOTIFICATION).SetSwitch(true);
            }
        }
        break;
        }


        //-----------------------------------------------
        // 状態を保存する
        //-----------------------------------------------
        LocalSaveOption cOption = LocalSaveManager.Instance.LoadFuncOption();

        cOption.m_OptionBGM              = CheckSwitch(OptionMenu.ItemType.BGM) ? (int)LocalSaveDefine.OptionBGM.ON : (int)LocalSaveDefine.OptionBGM.OFF;
        cOption.m_OptionSE               = CheckSwitch(OptionMenu.ItemType.SE) ? (int)LocalSaveDefine.OptionSE.ON : (int)LocalSaveDefine.OptionSE.OFF;
        cOption.m_OptionGuide            = CheckSwitch(OptionMenu.ItemType.GUIDE) ? (int)LocalSaveDefine.OptionGuide.ON : (int)LocalSaveDefine.OptionGuide.OFF;
        cOption.m_OptionSpeed            = CheckSwitch(OptionMenu.ItemType.SPEED) ? (int)LocalSaveDefine.OptionSpeed.ON : (int)LocalSaveDefine.OptionSpeed.OFF;
        cOption.m_OptionBattleSkillTurn  = CheckSwitch(OptionMenu.ItemType.SKILL_TURN) ? (int)LocalSaveDefine.OptionBattleSkillTurn.ON : (int)LocalSaveDefine.OptionBattleSkillTurn.OFF;
        cOption.m_OptionConfirmAS        = CheckSwitch(OptionMenu.ItemType.CONFIRM_AS) ? (int)LocalSaveDefine.OptionConfirmAS.ON : (int)LocalSaveDefine.OptionConfirmAS.OFF;
        cOption.m_OptionBattleSkillCost  = CheckSwitch(OptionMenu.ItemType.SKILL_COST) ? (int)LocalSaveDefine.OptionBattleSkillCost.ON : (int)LocalSaveDefine.OptionBattleSkillCost.OFF;
        cOption.m_OptionBattleAchieve    = CheckSwitch(OptionMenu.ItemType.BATTLE_ACHIEVE) ? (int)LocalSaveDefine.OptionBattleAchieve.ON : (int)LocalSaveDefine.OptionBattleAchieve.OFF;
        cOption.m_OptionQuestEndTips     = CheckSwitch(OptionMenu.ItemType.QUEST_END_TIPS) ? (int)LocalSaveDefine.OptionQuestEndTips.ON : (int)LocalSaveDefine.OptionQuestEndTips.OFF;
        cOption.m_OptionAutoPlayStopBoss = CheckSwitch(OptionMenu.ItemType.AUTO_PLAY_STOP_BOSS) ? (int)LocalSaveDefine.OptionAutoPlayStopBoss.ON : (int)LocalSaveDefine.OptionAutoPlayStopBoss.OFF;
        cOption.m_OptionAutoPlayUseAS    = CheckSwitch(OptionMenu.ItemType.AUTO_PLAY_USE_AS) ? (int)LocalSaveDefine.OptionAutoPlayUseAS.ON : (int)LocalSaveDefine.OptionAutoPlayUseAS.OFF;

        cOption.m_OptionNotification = CheckSwitch(OptionMenu.ItemType.NOTIFICATION) ? (int)LocalSaveDefine.OptionNotification.ON : (int)LocalSaveDefine.OptionNotification.OFF;

        cOption.m_NotificationEvent      = CheckSwitch(OptionMenu.ItemType.NOT_EVENT) ? (int)LocalSaveDefine.OptionNotificationEvent.ON : (int)LocalSaveDefine.OptionNotificationEvent.OFF;
        cOption.m_NotificationStaminaMax = CheckSwitch(OptionMenu.ItemType.NOT_STAMINA) ? (int)LocalSaveDefine.OptionNotificationStaminaMax.ON : (int)LocalSaveDefine.OptionNotificationStaminaMax.OFF;

        LocalSaveManager.Instance.SaveFuncOption(cOption);
    }
コード例 #3
0
 public void OnSelect(OptionMenu.ItemType _type)
 {
     if (_type == OptionMenu.ItemType.NOTIFICATION)
     {
         if (optionMenu.GetOptionItem(OptionMenu.ItemType.NOTIFICATION).IsSwitch())
         {
             for (int i = (int)OptionMenu.ItemType.NOT_EVENT; i < (int)OptionMenu.ItemType.MAX; i++)
             {
                 optionMenu.GetOptionItem((OptionMenu.ItemType)i).SetSwitch(true);
                 UnityUtil.SetObjectEnabledOnce(optionMenu.GetOptionItem((OptionMenu.ItemType)i).gameObject, true);
             }
         }
         else
         {
             for (int i = (int)OptionMenu.ItemType.NOT_EVENT; i < (int)OptionMenu.ItemType.MAX; i++)
             {
                 optionMenu.GetOptionItem((OptionMenu.ItemType)i).SetSwitch(false);
                 UnityUtil.SetObjectEnabledOnce(optionMenu.GetOptionItem((OptionMenu.ItemType)i).gameObject, false);
             }
         }
     }
 }
コード例 #4
0
 public bool CheckSwitch(OptionMenu.ItemType _type)
 {
     return(m_OptionMenu.GetOptionItem(_type).IsSwitch());
 }