备份CatanBuilding瘦身独立工程
This commit is contained in:
33
Assets/Scripts/SandDig/GameScript/PropBoxItem.cs
Normal file
33
Assets/Scripts/SandDig/GameScript/PropBoxItem.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using asap.core;
|
||||
using Game;
|
||||
using System;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.RuntimeScript.GameLogic
|
||||
{
|
||||
public class PropBoxItem : MonoBehaviour
|
||||
{
|
||||
public GameObject fx_diggingbox_finish;
|
||||
IDisposable disposable;
|
||||
private void OnEnable()
|
||||
{
|
||||
disposable = GContext.OnEvent<EventSandDigNewClamp>().Subscribe(OnPassClamp);
|
||||
}
|
||||
private void OnPassClamp(EventSandDigNewClamp obj)
|
||||
{
|
||||
//if (transform.childCount > 0)
|
||||
//{
|
||||
// fx_diggingbox_finish = transform.GetChild(0).gameObject;
|
||||
fx_diggingbox_finish?.SetActive(false);
|
||||
fx_diggingbox_finish?.SetActive(true);
|
||||
//}
|
||||
GContext.Publish(new EventUISound("audio_ui_sanddig_itemfinish"));
|
||||
}
|
||||
private void OnDisable()
|
||||
{
|
||||
disposable?.Dispose();
|
||||
disposable = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user