Пример #1
0
    void OnMouseUp()
    {
        if (!isCardFlipped)
        {
            startingRotation = transform.rotation.eulerAngles;

            targetRotation = new Vector3(270f, 180f, transform.rotation.z);

            float x = -5f + (CardController.ActiveCardsCount() * 2);
            //float z = CardController.ActiveCardsCount() * -.1f;

            targetPosition = new Vector3(x, 2f, 0f);
            CardController.IncrementActiveCards();

            StartCoroutine(SwitchCardFlippedBool());
        }
        else
        {
            startingRotation = transform.rotation.eulerAngles;

            targetRotation = new Vector3(270f, 0f, transform.rotation.z);
            CardController.DecrementActiveCards();

            targetPosition = initialPosition;

            StartCoroutine(SwitchCardFlippedBool());
        }
    }