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

public class DongleToySelect : MonoBehaviour
{
    // Start is called before the first frame update
    private LovenseDongleToy thisToy;

    [SerializeField]
    public Toggle toggle;

    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void SetData(LovenseDongleToy toy)
    {
        thisToy = toy;
        if (toy.name == null || toy.name == "")
        {
            this.transform.Find("Text").GetComponent<Text>().text = toy.id;
        }
        else
        {
            this.transform.Find("Text").GetComponent<Text>().text = toy.name;
        }
    }

    public LovenseDongleToy GetData()
    {
        return thisToy;
    }

    public bool IsCheck()
    {
        return toggle.isOn;
    }
}
