Example #1
0
        public override void EditorDraw()
        {
            foreach (var target in DebugObserver.GetObjects(Type))
            {
                if (target.GetInstanceID() != Id)
                {
                    continue;
                }

                if (IsReadOnly)
                {
                    using (new EditorGUI.DisabledScope(IsReadOnly))
                    {
                        DrawField(Name, _fieldInfo.FieldType, _fieldInfo.GetValue(target));
                    }

                    continue;
                }

                EditorGUI.BeginChangeCheck();
                var obj = DrawField(Name, _fieldInfo.FieldType, _fieldInfo.GetValue(target));
                if (EditorGUI.EndChangeCheck())
                {
                    _fieldInfo.SetValue(target, obj);
                }
            }
        }
Example #2
0
        public override void EditorDraw()
        {
            foreach (var target in DebugObserver.GetObjects(Type))
            {
                if (target.GetInstanceID() != Id)
                {
                    continue;
                }

                if (_parameterInfos.Length > 0 && _defineParameters.Length == _parameterInfos.Length)
                {
                    if (GUILayout.Button(Name))
                    {
                        DebugObserver.Invoke(Path, Name, _defineParameters);
                    }

                    continue;
                }

                for (var i = 0; i < _parameterInfos.Length; i++)
                {
                    Parameters[i] = DrawField(
                        _args.Length > i ? _args[i] : _parameterInfos[i].Name,
                        _parameterInfos[i].ParameterType,
                        Parameters[i]
                        );
                }

                if (GUILayout.Button(Name))
                {
                    DebugObserver.Invoke(Path, Name, Parameters);
                }
            }
        }
Example #3
0
        private void OnGUI()
        {
            if (!EditorApplication.isPlaying)
            {
                EditorGUILayout.HelpBox("Valid Editor Playing.", MessageType.Info);
                return;
            }

            DebugObserver.EditorDraw();
        }