Exemple #1
0
        private void OnEnable()
        {
            if (this.target == null)
            {
                return;
            }

            // Entire class/component marked as hidden - enable "hide in inspector".
            if (this.target.GetType().GetCustomAttributes(typeof(HideInInspector), false).Length > 0)
            {
                this.target.hideFlags |= HideFlags.HideInInspector;
            }

            ToolManager.OnTargetEditorEnable(this.targets);
        }
Exemple #2
0
        private void OnEnable()
        {
            if (this.target == null)
            {
                return;
            }

            m_targetType        = this.target.GetType();
            m_targetGameObjects = this.targets.Where(obj => obj is Component)
                                  .Select(obj => (obj as Component).gameObject).ToArray();
            m_numTargetGameObjectsTargetComponents = m_targetGameObjects.Sum(go => go.GetComponents(m_targetType).Length);

            // Entire class/component marked as hidden - enable "hide in inspector".
            if (this.target.GetType().GetCustomAttributes(typeof(HideInInspector), false).Length > 0)
            {
                this.target.hideFlags |= HideFlags.HideInInspector;
            }

            ToolManager.OnTargetEditorEnable(this.targets);
        }