public SceneTab(Context context, string title, Vector2?initialSize = null, string placeNextToDock = null, DockSlot slot = DockSlot.SlotNone) : base(context, title, initialSize, placeNextToDock, slot) { _iconCache = GetSubsystem <IconCache>(); WindowFlags = WindowFlags.NoScrollbar; _view = new SceneView(Context); _gizmo = new Gizmo(Context); _view.Scene.LoadXml(Cache.GetResource <XMLFile>("Scenes/SceneLoadExample.xml").GetRoot()); CreateObjects(); SubscribeToEvent <Update>(OnUpdate); SubscribeToEvent <PostUpdate>(args => RenderNodeContextMenu()); SubscribeToEvent <GizmoSelectionChanged>(args => { _selectedComponent = null; }); _eventArgs.Clear(); _eventArgs[InspectHierarchy.HierarchyProvider] = Variant.FromObject(this); SendEvent <InspectHierarchy>(_eventArgs); }
public void SendEvent(StringHash eventType, IDictionary <StringHash, dynamic> args) { _args.Clear(); if (args != null) { foreach (var pair in args) { _args[pair.Key] = new Variant(pair.Value); } args.Clear(); } SendEvent(eventType, _args); }