/// <summary> /// Create a new CrowdAuthoringEditor with the given line renderer. /// </summary> /// <param name="renderer">The line renderer for rendering lines in the main window.</param> public CrowdAuthoringEditor(AbstractLineRenderer renderer) { try { highlighter = Highlighter.Instance; objectSidebar = new Sidebar<SmartObject>(true, ObjectContentString); objectSidebar.RegisterLeftClickAction(highlighter.HighlightAfterUnhighlight); objectSidebar.RegisterLeftClickAction(OnParticipantDragStart); eventSidebar = new Sidebar<EventStub>(true, (EventStub e) => new GUIContent(e.Name)); eventSidebar.RegisterLeftClickAction(OnEventDragStart); eventSidebar.allObjects.UnionWith(AllEvents()); PeriodicMethodCaller.GetInstance().StartCallPeriodically(FindAllSmartObjects, 1.0f); actionBars = new List<ActionBar>(); notificationBar = new NotificationBar("This is the main view, where you can see all your upcoming events"); defaultBar = DefaultBar(); selectCrowdBar = SelectCrowdBar(); optionsBar = OptionsBar(); actionBars.Add(defaultBar); mainArea = mainWindow = new MainWindow(AuthoredEventManager.Instance, this, renderer); mainWindow.RegisterLeftClickAction(highlighter.HighlightAfterUnhighlight); positionSelectAction = new MouseHandler.ClickActions((RaycastHit hit) => { }, TryCreateWaypoint); MouseHandler.GetInstance().RegisterClickEvents(positionSelectAction); RectanglePainter painter = RectanglePainter.GetWithColor(Color.blue); drawRectangleAction = new MouseHandler.DragActions(painter.StartPainting, painter.ContinuePainting, (Vector3 pos) => painter.StopPainting()); crowdRectangleSelectAction = new MouseHandler.DragActions(OnSelectionStart, (Vector3 pos) => { }, OnSelectionStopped); EventCollectionManager.Instance.SetAllCollections(EventCollectionSerializer.Instance.Load()); } catch (Exception e) { Debug.Log(e.StackTrace); Debug.Log(e.Message); Debug.Log(e.Source); mustClose = true; } }