コード例 #1
0
 // Event handler for context clicks on entity widgets
 // we offer options to remove the entity or create a relation that originates from it
 public virtual void OnEntityContextClick(IEnumerable <T> entities, GenericMenu menu)
 {
     menu.AddItem(new GUIContent("Remove entity"), false, () => { foreach (var e in entities)
                                                                  {
                                                                      DeleteEntity(e);
                                                                  }
                  });
     menu.AddItem(new GUIContent("Add relation"), false, () => api.InitRelation(entities.ToArray()));
 }