示例#1
0
    /// <summary> Called when the second card is selected and is a match. Call in MemoryGameManager.cs </summary>
    public void FlipCard()
    {
        // Calls the flip event.
        if (FlipEvent != null)
        {
            FlipEvent.Invoke();
        }

        isMatched = true;
    }
示例#2
0
    private void OnClick(TouchWrapper wrapper, bool isOverGameObjects)
    {
        var touch = wrapper.GetTouch();

        if (touch.phase != TouchPhase.Began || IsBlocked || !_canFlip)
        {
            return;
        }
        _canFlip = false;
        Invoke(nameof(AllowFlipping), FlipInterruption);
        FlipEvent?.Invoke();
    }
 public void Flip()
 {
     FlipEvent?.Invoke();
 }
示例#4
0
 // calls the specified flip event with args, or generates the current ones if needed
 private void CallFlipEvent(FlipEvent evt, FlipEventArgs args = null)
 {
     evt?.Invoke(args ?? CurrentArgs);
 }