public override void OnInspectorGUI() { var link = (EntityLink)target; if (link.entity != null) { if (GUILayout.Button("Unlink")) { link.Unlink(); } } if (link.entity != null) { EditorGUILayout.Space(); EditorGUILayout.LabelField(link.entity.ToString()); if (GUILayout.Button("Show entity")) { Selection.activeGameObject = FindObjectsOfType <EntityBehaviour>() .Single(e => e.entity == link.entity).gameObject; } EditorGUILayout.Space(); EntityDrawer.DrawEntity(link.entity); } else { EditorGUILayout.LabelField("Not linked to an entity"); } }
public override void OnInspectorGUI() { if (targets.Length == 1) { var entityBehaviour = (EntityBehaviour)target; EntityDrawer.DrawEntity(entityBehaviour.entity); } else { var entities = targets .Select(t => ((EntityBehaviour)t).entity) .ToArray(); EntityDrawer.DrawMultipleEntities(entities); } if (target != null) { EditorUtility.SetDirty(target); } }