Example #1
0
 private void SendCardsToPositions()
 {
     for (int i = 0; i < _cardTransforms.Count; i++)
     {
         _cardViewMover.MoveCard(_cardTransforms[i], SamplePosition(i), Quaternion.identity);
     }
 }
Example #2
0
        private void SetPositions(float startingAngelInDegrees, float angelBetweenCardsInDegrees)
        {
            for (int i = 0; i < _cards.Count; i++)
            {
                float currentAngle = startingAngelInDegrees - i * angelBetweenCardsInDegrees;

                Vector3 offsetPosition = new Vector3
                {
                    x = Mathf.Cos(currentAngle * Mathf.Deg2Rad) * _radius,
                    y = Mathf.Sin(currentAngle * Mathf.Deg2Rad) * _radius
                };

                Vector3    targetPosition = _centralPoint + offsetPosition;
                Quaternion targetRotation = Quaternion.Euler(Vector3.forward * (currentAngle - 90f));

                _cardViewMover.MoveCard(_cards[i].transform, targetPosition, targetRotation);
            }
        }