public IEnumerator ResetCollider() { resettingCollider = true; #if UNITY_EDITOR if (EditorApplication.isPlaying) { #endif boxCollider = gameObject.GetComponent <BoxCollider>(); BoxCollider newBoxCollider = gameObject.AddComponent <BoxCollider>(); Destroy(boxCollider); yield return(0); boxCollider = newBoxCollider; rowContainer.MoveChildren(); #if UNITY_EDITOR } else { boxCollider = gameObject.GetComponent <BoxCollider>(); BoxCollider newBoxCollider = gameObject.AddComponent <BoxCollider>(); DestroyImmediate(boxCollider); boxCollider = newBoxCollider; rowContainer.MoveChildren(); } #endif resettingCollider = false; }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(padding); EditorGUILayout.PropertyField(spacing); EditorGUILayout.PropertyField(alignment); EditorGUILayout.PropertyField(bounds); EditorGUILayout.PropertyField(log); serializedObject.ApplyModifiedProperties(); if (GUILayout.Button("Move Children")) { if (target.GetType() == typeof(RowContainer)) { RowContainer rowContainer = (RowContainer)target; rowContainer.MoveChildren(); } } }