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

public class LandAnimation : MonoBehaviour
{
    public GameObject showPlayWater;
    public GameObject showPlayGetGoods;




    public void showPlayWaterAnim()
    {
        if (showPlayWater.activeSelf != true)
        {
            showPlayWater.SetActive(true);
        }
    }
    public void closePlayWaterAnim()
    {
        if (showPlayWater.activeSelf != false)
        {
            showPlayWater.SetActive(false);
        }
    }

    private bool isGetGoodsSuccess = false;
    public int tempFruitID=0;
    public int tempCoinNum = 0;
    //果实id
    public int getTempFruitId
    {
        get { return tempFruitID; }
    }

    //金币数量
    public int getTempCoinNum
    {
        get { return tempCoinNum; }
    }

    private void Update()
    {
        //if (isGetGoodsSuccess)
        //{
        //    isGetGoodsSuccess = false;
        //    try
        //    {
        //        if (showPlayGetGoods.activeSelf != false)
        //        {
        //            showPlayGetGoods.GetComponent<WareItem>().setFruitType(tempFruitID);
        //            showPlayGetGoods.GetComponent<WareItem>().setGoodsData(tempCoinNum);
        //        }
        //    }
        //    catch(Exception e)
        //    {

        //    }
           
        //}
        
    }

    public void showPlayGetGoodsAnim(int fruitId,int coinNum)
    {
        Debug.Log("收获动画1  ：" + fruitId);
        tempFruitID = fruitId;
        tempCoinNum = coinNum;
        Debug.Log("收获动画2  ：" + coinNum);
        showPlayGetGoods.SetActive(true);
        //if (showPlayGetGoods.activeSelf != true)
        //{
        //    showPlayGetGoods.SetActive(true);
        //    //isGetGoodsSuccess = true;
        //    //showPlayGetGoods.GetComponent<WareItem>().setFruitType(fruitId);
        //    //showPlayGetGoods.GetComponent<WareItem>().setGoodsData(coinNum);
        //}
    }

    public void closePlayGetGoodsAnim()
    {
        if (showPlayGetGoods.activeSelf != false)
        {
            showPlayGetGoods.SetActive(false);
        }
    }

}
