//体重ボタンをタップした際に実行される
    public void OnWeightButtonTap()
    {
        //ピッカーを表示して体重を設定させる
        string title        = "体重設定";
        string unit         = "kg";
        float  maxValue     = 200.9f;
        float  minValue     = 30f;
        float  stepValue    = 0.1f;
        float  currentValue = UserDataManager.Setting.Profile.GetWeight();
        var    vs           = new SelectValueDialogParamSet(
            SelectValueDialogParamSet.DISPLAY_TYPE.Numeric,
            title,
            unit,
            maxValue,
            minValue,
            stepValue,
            currentValue);

        SelectValueDialog.Show(vs, (SelectValueDialog.ButtonItem status, float value, GameObject dialog) => {
            if (status == SelectValueDialog.ButtonItem.OK)
            {
                //結果をテキストに反映
                weightText.text = value.ToString("0.0") + unit;
                //アプリ内保存
                UserDataManager.Setting.Profile.SaveWeight(value);
                OnChangeSetting();
            }
            else
            {
                //なにもしない
            }
        });
    }
Exemple #2
0
    /// <summary>
    /// 抑制開始時間ボタン押下イベントハンドラ
    /// </summary>
    public void OnSuppressionStartTimeButtonTap()
    {
        //ピッカーを表示して抑制開始時間を設定させる
        string title        = "抑制開始時間設定";
        string unit         = "分";
        float  maxValue     = (float)SuppressionStartTime.Max;
        float  minValue     = (float)SuppressionStartTime.Min;
        float  stepValue    = 1;
        float  currentValue = (float)TempDeviceSetting.SuppressionStartTime;
        var    vs           = new SelectValueDialogParamSet(
            SelectValueDialogParamSet.DISPLAY_TYPE.Numeric,
            title,
            unit,
            maxValue,
            minValue,
            stepValue,
            currentValue);

        SelectValueDialog.Show(vs, (SelectValueDialog.ButtonItem status, float value, GameObject dialog) => {
            if (status == SelectValueDialog.ButtonItem.OK)
            {
                //結果をテキストに反映
                suppressionStartTimeText.text = value.ToString("0") + unit;

                //アプリ内保存
                TempDeviceSetting.SuppressionStartTime = (SuppressionStartTime)value;
                SaveDeviceSetting();
            }
            else
            {
                //なにもしない
            }
        });
    }