45 lines
947 B
C#
45 lines
947 B
C#
using UnityEngine;
|
|
|
|
public class SupplyDropCashItem : MonoBehaviour
|
|
{
|
|
bool inUse = false;
|
|
public int type = 0; // 0~4
|
|
public Animator rootAni;
|
|
public Animator cashAni;
|
|
public BoxCollider boxCollider;
|
|
public int cashCount = 0;
|
|
|
|
public GameObject fx_reward;
|
|
public GameObject fx_idle;
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="index">1~5</param>
|
|
public void PlayAni(int index)
|
|
{
|
|
rootAni.SetTrigger($"Fly0{index}");
|
|
cashAni.SetTrigger($"Fly0{index}");
|
|
}
|
|
|
|
public void SetClick(int cashCount)
|
|
{
|
|
this.cashCount = cashCount;
|
|
inUse = true;
|
|
boxCollider.enabled = true;
|
|
fx_idle.SetActive(true);
|
|
}
|
|
|
|
|
|
public void OnClick()
|
|
{
|
|
if (!inUse)
|
|
{
|
|
return;
|
|
}
|
|
fx_idle.SetActive(false);
|
|
fx_reward.SetActive(true);
|
|
inUse = false;
|
|
boxCollider.enabled = false;
|
|
}
|
|
}
|