private void Apply() { var category = (serializedObject.targetObject as BuildingPiece).GetComponentInParent <BuildingCategory>(); if (category != null) { BuildingCategoryEditor.ApplyForCategory(category); } }
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; } }