Exemplo n.º 1
0
        private void Apply()
        {
            var category = (serializedObject.targetObject as BuildingPiece).GetComponentInParent <BuildingCategory>();

            if (category != null)
            {
                BuildingCategoryEditor.ApplyForCategory(category);
            }
        }
Exemplo n.º 2
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;
            }
        }