public void OnClick(CardBehavior instance) { if (!_isAnimationRunning) { _isAnimationRunning = true; instance.PlayAnimation(); instance.PlayAudio(); Context.GetInstance().firstInstance = instance; } }
public void OnClick(CardBehavior instance) { if (!_isAnimationRunning && Context.GetInstance().firstInstance.GetInstanceID() != instance.GetInstanceID()) { ; } { _isAnimationRunning = true; instance.PlayAnimation(); instance.PlayAudio(); Context.GetInstance().secondInstance = instance; } }
public void Validation() { CardBehavior firstCard = Context.GetInstance().firstInstance; CardBehavior secondCard = Context.GetInstance().secondInstance; if (firstCard.GetCurrentSprite().name == secondCard.GetCurrentSprite().name) { Context.GetInstance().firstInstance.Dispose(); Context.GetInstance().secondInstance.Dispose(); Context.GetInstance().currentState = Context.GetInstance().NoCards; Context.GetInstance().firstInstance = null; Context.GetInstance().secondInstance = null; } else { firstCard.PlayAnimation(); secondCard.PlayAnimation(); } }