/// <summary> /// Constructor, creates the inspector logger. /// </summary> public InspectorManager(IUserInterface userInterface) : base(GearsetSettings.Instance.InspectorConfig) { Config = GearsetSettings.Instance.InspectorConfig; _userInterface = userInterface; _userInterface.CreateInspector(this); }
public InspectorUI(InspectorConfig config, ICollection <IWindow> windows) { Config = config; Notices = new ObservableCollection <NoticeViewModel>(); _inspectorWindow = new Inspector { Top = Config.Top, Left = Config.Left, Width = Config.Width, Height = Config.Height, DataContext = this }; Config.ModifiedOnlyChanged += Config_ModifiedOnlyChanged; Config.SearchTextChanged += Config_SearchTextChanged; _updateSearchFilteringDelay = 0.25f; if (Config.Visible) { _inspectorWindow.Show(); } windows.Add(_inspectorWindow); WindowHelper.EnsureOnScreen(_inspectorWindow); // This is needed in order to correctly handle keyboard input. ElementHost.EnableModelessKeyboardInterop(_inspectorWindow); InspectorNode.ExtensionMethodTypes.Add(typeof(InspectorExtensionsMethods)); // Create both item sources. InspectedObjects = new ObservableCollection <InspectorNode>(); WatchedNodes = new ObservableCollection <InspectorNode>(); MethodCallers = new ObservableCollection <MethodCaller>(); var source = new CollectionViewSource(); source.Source = InspectedObjects; source.View.Filter = FilterPredicate; _inspectorWindow.TreeView1.ItemsSource = source.View; _inspectorWindow.TreeView1.ItemContainerGenerator.StatusChanged += ItemContainerGenerator1_StatusChanged; _inspectorWindow.TreeView1.SelectedItemChanged += TreeView1_SelectedItemChanged; _inspectorWindow.plots.DataContext = GearsetResources.Console.Plotter.Plots; _inspectorWindow.LocationChanged += (sender, args) => _inspectorLocationJustChanged = true; _inspectorWindow.SizeChanged += (sender, args) => _inspectorLocationJustChanged = true; _inspectorWindow.IsVisibleChanged += (sender, args) => Config.Visible = _inspectorWindow.IsVisible; }
private void BuildInspector(object targetObject, InspectorConfig config) { ClearInspector(); var instructions = config.GetDrawInstructions(targetObject); foreach (var instruction in instructions) { instruction.Run(parent); } }
public void InspectObject(object targetObject, InspectorConfig config = null) { if (targetObject == null) { throw new ArgumentNullException(nameof(targetObject)); } if (targetObject.GetType().IsPrimitive) { throw new ArgumentException("Target object cannot be a primitive type", nameof(targetObject)); } if (config == null) { config = InspectorConfig.ConfigSelector.Select(targetObject); } BuildInspector(targetObject, config); }
public void AddInspectorView(object targetObject, InspectorConfig config) { if (targetObject == null) { throw new ArgumentNullException(nameof(targetObject)); } if (targetObject.GetType().IsPrimitive) { throw new ArgumentException("Target object cannot be a primitive type", nameof(targetObject)); } var stackElement = Instantiate(templates.inspectorView, parent); stackElement.gameObject.SetActive(true); stackElement.InspectObject(targetObject, config); stack.Add(stackElement.gameObject); OnStackChanged?.Invoke(); }
public GearsetSettings() { Enabled = true; ShowOverlays = true; #if WINDOWS InspectorConfig = new InspectorConfig(); LoggerConfig = new LoggerConfig(); #endif ProfilerConfig = new ProfilerConfig(); DataSamplerConfig = new DataSamplerConfig(); PlotterConfig = new PlotterConfig(); TreeViewConfig = new TreeViewConfig(); LabelerConfig = new LabelerConfig(); LineDrawerConfig = new LineDrawerConfig(); AlerterConfig = new AlerterConfig(); #if WINDOWS FinderConfig = new FinderConfig(); #endif // IMPORTANT: // NEW CONFIG INSTANCES SHOULD BE ADDED IN THE LOAD METHOD BELOW. DepthBufferEnabled = true; _saveFrequency = 5; }
void OnEnable() { config = (InspectorConfig)target; }
public static void init() { config = GameObject.Find("InspectorConfig").GetComponent <InspectorConfig>(); }
public static void init() { config = GameObject.Find("InspectorConfig").GetComponent<InspectorConfig>(); }
private void Awake() { InspectorConfig.Init(builtInPrefabs); }