コード例 #1
0
        /// <summary>
        /// Constructor, creates the inspector logger.
        /// </summary>
        public InspectorManager(IUserInterface userInterface)
            : base(GearsetSettings.Instance.InspectorConfig)
        {
            Config = GearsetSettings.Instance.InspectorConfig;

            _userInterface = userInterface;
            _userInterface.CreateInspector(this);
        }
コード例 #2
0
ファイル: InspectorUI.cs プロジェクト: edwinsyarief/Gearset
        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;
        }
コード例 #3
0
        private void BuildInspector(object targetObject, InspectorConfig config)
        {
            ClearInspector();

            var instructions = config.GetDrawInstructions(targetObject);

            foreach (var instruction in instructions)
            {
                instruction.Run(parent);
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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;
        }
コード例 #7
0
 void OnEnable()
 {
     config = (InspectorConfig)target;
 }
コード例 #8
0
 void OnEnable()
 {
     config = (InspectorConfig)target;
 }
コード例 #9
0
ファイル: Debug.cs プロジェクト: fordream/Hellikitty
 public static void init()
 {
     config = GameObject.Find("InspectorConfig").GetComponent <InspectorConfig>();
 }
コード例 #10
0
ファイル: Debug.cs プロジェクト: kiwipxl/Hellikitty
 public static void init()
 {
     config = GameObject.Find("InspectorConfig").GetComponent<InspectorConfig>();
 }
コード例 #11
0
 private void Awake()
 {
     InspectorConfig.Init(builtInPrefabs);
 }