Esempio n. 1
0
    /// <summary>
    /// Raises the pointer click event.
    /// </summary>
    /// <param name="eventData">Event data.</param>
    public void OnPointerClick(PointerEventData eventData)
    {
        //Debug.Log("Card OnPointerClick");
        // TODO: if the state of this card is not ready. break the functions.

        if (!IsReady())
        {
            return;
        }


        // TODO: Turn off hint.
        HintDisplay.Instance.DisableHint();

        // TODO: Check if the card is using.
        if (stateTouched != Enums.StateTouch.None)
        {
            // TODO: Break the function.
            return;
        }

        SoundSystems.Instance.PlaySound(Enums.SoundIndex.Press);

        // TODO: update the number of move.
        UIBehaviours.Instance.UpdateMove(1, true);

        // TODO: Set the state of touch.
        stateTouched = Enums.StateTouch.Touch;

        // TODO: Set Up the information before following.
        BeginFollow();
        GamePlay.Instance.checkAutoWin();
        // TODO: Check the Playing zone.
        if (DoCheckPlayingZone(false))
        {
            // TODO: Reset the state of touching.
            stateTouched = Enums.StateTouch.None;

            // TODO: Break the functions.
            return;
        }

        // TODO: Reset the state of touching.
        stateTouched = Enums.StateTouch.None;
        //Debug.Log("--TargetPosition: " + TargetPosition);
        //Debug.Log("--pos: " + transform.position);
        // TODO: Back to the current position.

        Moving(TargetPosition, parentTransform, () => {
            // TODO: Distribute the follow cards.
            DistributeTheFollowCards();

            // TODO: Failed Collect;
            AnimationFailedCollect();
        });
    }
Esempio n. 2
0
    /// <summary>
    /// Raises the enable event.
    /// </summary>
    void OnEnable()
    {
        // TODO: Reset the state of touches.
        stateTouched = Enums.StateTouch.None;

        // TODO: Reset the state of card.
        stateCard = Enums.StateCard.None;

        // TODO: Rize the images of cards.
        ResizeImage();
    }
Esempio n. 3
0
    public void ResetCards()
    {
        // TODO: Reset the state of touches.
        stateTouched = Enums.StateTouch.None;

        // TODO: Reset the state of card.
        stateCard = Enums.StateCard.None;

        // TODO: Rize the images of cards.
        ResizeImage();

        switch (GameManager.Instance.GameType)
        {
        case Enums.GameScenes.Spider:

            if (_SCardBehaviour == null)
            {
                // TODO: Create the new class.
                _SCardBehaviour = new SPIDER._CardBehaviour(this);
            }
            break;

        case Enums.GameScenes.Tripeaks:

            if (_TCardBehaviour == null)
            {
                // TODO: Create the new class.
                _TCardBehaviour = new TRIPEAKS._CardBehaviour(this);
            }
            break;

        case Enums.GameScenes.Klondike:

            if (_KCardBehaviour == null)
            {
                // TODO: Create the new class.
                _KCardBehaviour = new KLONDIKE._CardBehaviour(this);
            }
            break;
        }

        // TODO: Reset the color.
        UIRenderer.color = new Color(UIRenderer.color.r, UIRenderer.color.g, UIRenderer.color.b, 1f);
    }