You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Feel/FeelDemos/CardsUI/Scripts/FeelCardsUIStackButton.cs

35 lines
768 B
C#

3 months ago
using System.Collections;
using System.Collections.Generic;
using MoreMountains.Feedbacks;
using UnityEngine;
namespace MoreMountains.Feel
{
public class FeelCardsUIStackButton : MonoBehaviour
{
/// the MMFeedback to play when pressing the stack button
public MMFeedbacks StackFeedback;
/// a list of feedbacks that should prevent the button from working if any of them is still playing
public List<MMFeedbacks> BlockerFeedbacks;
public virtual void Stack()
{
bool blocked = false;
foreach (MMFeedbacks feedbacks in BlockerFeedbacks)
{
if (feedbacks.IsPlaying)
{
blocked = true;
}
}
if (blocked)
{
return;
}
StackFeedback?.PlayFeedbacks();
this.gameObject.SetActive(false);
}
}
}