Esempio n. 1
0
        public static void ApplyForWheel(BuildingWheel wheel)
        {
            var categories = wheel.transform.GetComponentsInChildren <BuildingCategory>();

            for (int i = 0; i < categories.Length; i++)
            {
                categories[i].transform.localPosition = GetPositionForElement(wheel, i) + (Vector3)categories[i].DesiredOffset;
                BuildingCategoryEditor.ApplyForCategory(categories[i]);
            }

            if (wheel.SelectionHighlight != null)
            {
                wheel.SelectionHighlight.localPosition = GetPositionForElement(wheel, 0);
                wheel.SelectionHighlight.localRotation = Quaternion.identity;
            }
        }
Esempio n. 2
0
        private static Vector3 GetPositionForElement(BuildingWheel wheel, int index)
        {
            float angle = wheel.Offset + wheel.Spacing * index;

            return((Quaternion.Euler(Vector3.back * angle) * Vector3.up) * wheel.Distance);
        }