using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Seed_Not_Enouth : MonoBehaviour
{

    public Text videoBuySeedPriceTv;//种子不足购买价格
    public Text videoBuySeedNumTv;//种子不足看视频剩余次数
    public GameObject seedNoSprite;//种子不足弹窗显示物
    private bool isShowDialogSuccess = false;
    private void OnEnable()
    {
        isShowDialogSuccess = true;
    }
    private void Update()
    {
        if (isShowDialogSuccess)
        {
            //videoBuySeedPriceTv.text = "<color=#F9D348>" + GameObject.Find("dialog").GetComponent<DialogControl>().SeedBuyPrice + "</color> 购买";
            videoBuySeedPriceTv.text = GameObject.Find("dialog").GetComponent<DialogControl>().SeedBuyPrice.ToString();
            if (videoBuySeedNumTv != null)
            {
                if (GameObject.Find("dialog").GetComponent<DialogControl>().SeedVideoNum >= 0)
                {
                    videoBuySeedNumTv.text = "每天晚上0点重置视频次数 (剩余" + CoinNumControl.GetIns().getSubSeedVideoNum + "次)";
                }
                else
                {
                    videoBuySeedNumTv.text = "";
                }
            }
            try
            {
                seedNoSprite.GetComponent<WareItem>().setSeedType(GameObject.Find("dialog").GetComponent<DialogControl>().SeedId);
            }
            catch (Exception e)
            {
                Debug.Log("种子不足弹窗Error" + e.Message);
                GameObject.Find("dialog").GetComponent<DialogControl>().closeSeedNotEnough();
            }
            isShowDialogSuccess = false;
        }
    }


}
