备份CatanBuilding瘦身独立工程
This commit is contained in:
50
Assets/Scripts/UI/Washing/EventWashingConclusion.cs
Normal file
50
Assets/Scripts/UI/Washing/EventWashingConclusion.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using game;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
public class EventWashingConclusion : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public float displayTime = 1f;
|
||||
|
||||
private float remainingTime;
|
||||
|
||||
private bool isDisplaying = false;
|
||||
|
||||
public void ResetConclusion()
|
||||
{
|
||||
isDisplaying = false;
|
||||
remainingTime = 0f;
|
||||
}
|
||||
|
||||
public void StartConclusion()
|
||||
{
|
||||
if (isDisplaying) return;
|
||||
|
||||
remainingTime = displayTime;
|
||||
this.gameObject.SetActive(true);
|
||||
isDisplaying = true;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (remainingTime > 0)
|
||||
{
|
||||
remainingTime -= Time.deltaTime;
|
||||
if (remainingTime <= 0f)
|
||||
{
|
||||
isDisplaying = false;
|
||||
this.gameObject.SetActive(false);
|
||||
FishingYachtAct.Publish<EventWashingStepOverData>(new EventWashingStepOverData());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user