예제 #1
0
 private RadialCell(float radius, float angle, float size, float groupAngle, int siblings, RadialCell parent)
 {
     this.radius     = radius;
     this.size       = size;
     this.angle      = angle;
     this.parent     = parent;
     this.groupAngle = groupAngle;
     this.siblings   = siblings;
 }
예제 #2
0
        private static float ComputeNewSize(RadialCell parent)
        {
            var size = (parent.size - Config.IconSizeReductionDelta) * (float)Config.IconSizeReductionMult;

            return(Mathf.Max(size, Config.MinIconSize));
        }
예제 #3
0
 private static float ComputeNewRadius(RadialCell parent, float size)
 {
     return(parent.radius + parent.size / 2 + size / 2);
 }
예제 #4
0
        private static RadialCell CreateChildCellWithOneElementAtRoot(uGUI_CraftNode node, RadialCell parent)
        {
            var siblings    = node.parent.childCount;
            var size        = ComputeNewSize(parent);
            var radius      = ComputeNewRadius(parent, size);
            var index       = node.index;
            var maxSiblings = GetPolygonLineCount(radius, size);

            if (siblings > maxSiblings)
            {
                size = GetPolygonLineSize(radius, siblings);
            }
            var angleDelta = 2 * Mathf.PI / siblings;
            var angle      = angleDelta * index + GetExtraAngleOffset(siblings);

            return(new RadialCell(radius, angle, size, float.NaN, siblings, parent));
        }