Exemple #1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        UICard card = (UICard)target;

        if (card == null)
        {
            return;
        }

        if (GUILayout.Button("Flip"))
        {
            card.Flip();
        }
    }
Exemple #2
0
        public virtual void Play(SC_Player c)
        {
            if (OnTheRing && RingPlay())
            {
                return;
            }

            UI.messagePanel.SetActive(false);

            TryInterceptFinish();

            activeCard = this;

            if (!originalCard)
            {
                originalCard = this;
            }

            Caller = c;

            Receiver = Caller.IsLocalPlayer ? otherPlayer : localPlayer;

            UICard.RecT.SetParent(UICard.RecT.parent.parent);

            if (!OnTheRing)
            {
                Caller.Hand.Remove(this);

                SC_Deck.OrganizeHand(Caller.IsLocalPlayer ? GM.localHand : GM.otherHand);

                UICard.RecT.pivot = Vector2.one * .5f;

                UICard.RecT.anchoredPosition3D = Vector3.up * (Caller.IsLocalPlayer ? UICard.RecT.sizeDelta.y / 2 : (GM.transform as RectTransform).sizeDelta.y - UICard.RecT.sizeDelta.y / 2);
            }
            else
            {
                (Caller.IsLocalPlayer ? UI.localRingSlots : UI.otherRingSlots)[RingSlot].occupied = false;

                RingSlot = -1;
            }

            UICard.RecT.DOLocalMove(Vector3.zero, 1);

            DOTween.Sequence().Append(UICard.RecT.DOSizeDelta(UICard.RecT.sizeDelta * GM.playedSizeMultiplicator, 1)).OnComplete(() => { StartCoroutine(Use()); });

            UICard.Flip(!UICard.FaceUp, 1);
        }