备份CatanBuilding瘦身独立工程
This commit is contained in:
44
Assets/Scripts/SupplyDrop/SupplyDropCashItem.cs
Normal file
44
Assets/Scripts/SupplyDrop/SupplyDropCashItem.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user