コード例 #1
0
        private Vector3 FindValidPosition(float startAngle)
        {
            for (var i = 0; i <= numPositions; i++)
            {
                var angle  = GetAngleForIndex(i, GlobalConstants.CIRCLE_ANGLE / numPositions, startAngle);
                var pos    = VectorUtil.GetPositionForAngle(parent.position, tailDistance + GetPaddingForAngle(angle), angle);
                var newPos = camera.WorldToScreenPoint(pos);
                if (!BubblePositionValid(newPos))
                {
                    continue;
                }

                return(newPos);
            }

            var defaultPos = VectorUtil.GetPositionForAngle(parent.position, tailDistance + GetPaddingForAngle(startAngle), startAngle);

            return(camera.WorldToScreenPoint(defaultPos));
        }