﻿using Lovense.UnityKit.Android;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PresetPanel : MonoBehaviour {

    [SerializeField]
    public Slider preset_slider, preset_time;



    Func<List<string>> getToysCallback;


    // Start is called before the first frame update
    void Start()
    {
        
    }

    public void SetGetToysCallback(Func<List<string>> arg0)
    {
        getToysCallback = arg0;
    }

    public void SendPreset()
    {
        int mode = (int)preset_slider.value;
        float timeSec = preset_time.value;
        if (mode == 0)
        {
            LovenseAndroidSDK.GetInstance().ShowToast("please input the mode value!");
            return;
        }
        List<string> ids = getToysCallback();
               
        if (ids.Count == 0)
        {
            LovenseAndroidSDK.GetInstance().ShowToast("please select toys");
            return;
        }
        LovenseAndroidSDK.GetInstance().SendPreset(ids.ToArray(), mode, timeSec);

    }
}
