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; }
private static float ComputeNewSize(RadialCell parent) { var size = (parent.size - Config.IconSizeReductionDelta) * (float)Config.IconSizeReductionMult; return(Mathf.Max(size, Config.MinIconSize)); }
private static float ComputeNewRadius(RadialCell parent, float size) { return(parent.radius + parent.size / 2 + size / 2); }
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)); }