OnEnable() public method

public OnEnable ( SerializedObject serializedObject ) : void
serializedObject SerializedObject
return void
コード例 #1
0
        public override void OnEnable()
        {
            base.OnEnable();

            List <string> excludedProperties = new List <string>();

            excludedProperties.Add("m_LightProbeUsage");
            excludedProperties.Add("m_LightProbeVolumeOverride");
            excludedProperties.Add("m_ReflectionProbeUsage");
            excludedProperties.Add("m_ProbeAnchor");
            excludedProperties.Add("m_Parameters");
            excludedProperties.Add("m_RenderingLayerMask");
            m_ExcludedProperties = excludedProperties.ToArray();

            m_CurveEditor.OnEnable(serializedObject);
            m_ColorGradient        = serializedObject.FindProperty("m_Parameters.colorGradient");
            m_NumCornerVertices    = serializedObject.FindProperty("m_Parameters.numCornerVertices");
            m_NumCapVertices       = serializedObject.FindProperty("m_Parameters.numCapVertices");
            m_Alignment            = serializedObject.FindProperty("m_Parameters.alignment");
            m_TextureMode          = serializedObject.FindProperty("m_Parameters.textureMode");
            m_ShadowBias           = serializedObject.FindProperty("m_Parameters.shadowBias");
            m_GenerateLightingData = serializedObject.FindProperty("m_Parameters.generateLightingData");

            InitializeProbeFields();
        }
コード例 #2
0
        public override void OnEnable()
        {
            base.OnEnable();

            List <string> excludedProperties = new List <string>();

            excludedProperties.Add("m_Parameters");
            excludedProperties.AddRange(Probes.GetFieldsStringArray());
            if (!SupportedRenderingFeatures.active.rendererSupportsMotionVectors)
            {
                excludedProperties.Add("m_MotionVectors");
            }
            if (!SupportedRenderingFeatures.active.rendererSupportsReceiveShadows)
            {
                excludedProperties.Add("m_ReceiveShadows");
            }
            excludedProperties.Add("m_RenderingLayerMask");
            m_ExcludedProperties = excludedProperties.ToArray();

            m_CurveEditor.OnEnable(serializedObject);
            m_ColorGradient        = serializedObject.FindProperty("m_Parameters.colorGradient");
            m_NumCornerVertices    = serializedObject.FindProperty("m_Parameters.numCornerVertices");
            m_NumCapVertices       = serializedObject.FindProperty("m_Parameters.numCapVertices");
            m_Alignment            = serializedObject.FindProperty("m_Parameters.alignment");
            m_TextureMode          = serializedObject.FindProperty("m_Parameters.textureMode");
            m_GenerateLightingData = serializedObject.FindProperty("m_Parameters.generateLightingData");

            InitializeProbeFields();
        }
コード例 #3
0
        public override void OnEnable()
        {
            base.OnEnable();

            m_PointEditor = new LineRendererEditor(target as LineRenderer, this);
            m_PointEditor.Deselect();
            SceneView.onSceneGUIDelegate     += OnSceneGUIDelegate;
            Undo.undoRedoPerformed           += UndoRedoPerformed;
            EditMode.onEditModeStartDelegate += EditModeStarted;
            EditMode.onEditModeEndDelegate   += EditModeEnded;

            List <string> excludedProperties = new List <string>();

            excludedProperties.Add("m_Loop");
            excludedProperties.Add("m_Parameters");
            excludedProperties.Add("m_Positions");
            excludedProperties.AddRange(Probes.GetFieldsStringArray());
            if (!SupportedRenderingFeatures.active.rendererSupportsMotionVectors)
            {
                excludedProperties.Add("m_MotionVectors");
            }
            if (!SupportedRenderingFeatures.active.rendererSupportsReceiveShadows)
            {
                excludedProperties.Add("m_ReceiveShadows");
            }
            excludedProperties.Add("m_RenderingLayerMask");
            m_ExcludedProperties = excludedProperties.ToArray();

            m_CurveEditor.OnEnable(serializedObject);
            m_Loop                 = serializedObject.FindProperty("m_Loop");
            m_Positions            = serializedObject.FindProperty("m_Positions");
            m_PositionsSize        = serializedObject.FindProperty("m_Positions.Array.size");
            m_ColorGradient        = serializedObject.FindProperty("m_Parameters.colorGradient");
            m_NumCornerVertices    = serializedObject.FindProperty("m_Parameters.numCornerVertices");
            m_NumCapVertices       = serializedObject.FindProperty("m_Parameters.numCapVertices");
            m_Alignment            = serializedObject.FindProperty("m_Parameters.alignment");
            m_TextureMode          = serializedObject.FindProperty("m_Parameters.textureMode");
            m_GenerateLightingData = serializedObject.FindProperty("m_Parameters.generateLightingData");
            m_ShadowBias           = serializedObject.FindProperty("m_Parameters.shadowBias");

            m_PositionsView = new LineRendererPositionsView(m_Positions);
            m_PositionsView.selectionChangedCallback += PositionsViewSelectionChanged;

            m_ShowPositionsAnimation = new AnimBool(false, Repaint)
            {
                value = m_Positions.isExpanded
            };
            EditorApplication.contextualPropertyMenu += OnPropertyContextMenu;

            // We cannot access isEditingMultipleObjects when drawing the SceneView so we need to cache it here for later use.
            m_IsMultiEditing = serializedObject.isEditingMultipleObjects;

            InitializeProbeFields();
        }
コード例 #4
0
        public override void OnEnable()
        {
            base.OnEnable();

            var lineRenderer = target as LineRenderer;

            m_PointEditor = new LineRendererEditor(lineRenderer, this);

            m_PointEditor.Deselect();
            SceneView.duringSceneGui         += OnSceneGUIDelegate;
            Undo.undoRedoPerformed           += UndoRedoPerformed;
            EditMode.onEditModeStartDelegate += EditModeStarted;
            EditMode.onEditModeEndDelegate   += EditModeEnded;
            m_CurveEditor.OnEnable(serializedObject);

            m_Loop = serializedObject.FindProperty("m_Loop");
            m_ApplyActiveColorSpace = serializedObject.FindProperty("m_ApplyActiveColorSpace");
            m_Positions             = serializedObject.FindProperty("m_Positions");
            m_PositionsSize         = serializedObject.FindProperty("m_Positions.Array.size");
            m_ColorGradient         = serializedObject.FindProperty("m_Parameters.colorGradient");
            m_NumCornerVertices     = serializedObject.FindProperty("m_Parameters.numCornerVertices");
            m_NumCapVertices        = serializedObject.FindProperty("m_Parameters.numCapVertices");
            m_Alignment             = serializedObject.FindProperty("m_Parameters.alignment");
            m_TextureMode           = serializedObject.FindProperty("m_Parameters.textureMode");
            m_TextureScale          = serializedObject.FindProperty("m_Parameters.textureScale");
            m_GenerateLightingData  = serializedObject.FindProperty("m_Parameters.generateLightingData");
            m_ShadowBias            = serializedObject.FindProperty("m_Parameters.shadowBias");
            m_UseWorldSpace         = serializedObject.FindProperty("m_UseWorldSpace");
            m_MaskInteraction       = serializedObject.FindProperty("m_MaskInteraction");

            m_PositionsView = new LineRendererPositionsView(m_Positions);
            m_PositionsView.selectionChangedCallback += PositionsViewSelectionChanged;
            if (targets.Length == 1)
            {
                m_PositionsView.lineRenderer = lineRenderer;
            }

            m_ShowPositionsAnimation = new AnimBool(false, Repaint)
            {
                value = m_Positions.isExpanded
            };
            EditorApplication.contextualPropertyMenu += OnPropertyContextMenu;

            // We cannot access isEditingMultipleObjects when drawing the SceneView so we need to cache it here for later use.
            m_IsMultiEditing       = serializedObject.isEditingMultipleObjects;
            m_IsGameObjectEditable = (lineRenderer.gameObject.hideFlags & HideFlags.NotEditable) == 0;
        }
コード例 #5
0
        public override void OnEnable()
        {
            base.OnEnable();

            m_CurveEditor.OnEnable(serializedObject);
            m_Time = serializedObject.FindProperty("m_Time");
            m_MinVertexDistance    = serializedObject.FindProperty("m_MinVertexDistance");
            m_Autodestruct         = serializedObject.FindProperty("m_Autodestruct");
            m_Emitting             = serializedObject.FindProperty("m_Emitting");
            m_ColorGradient        = serializedObject.FindProperty("m_Parameters.colorGradient");
            m_NumCornerVertices    = serializedObject.FindProperty("m_Parameters.numCornerVertices");
            m_NumCapVertices       = serializedObject.FindProperty("m_Parameters.numCapVertices");
            m_Alignment            = serializedObject.FindProperty("m_Parameters.alignment");
            m_TextureMode          = serializedObject.FindProperty("m_Parameters.textureMode");
            m_ShadowBias           = serializedObject.FindProperty("m_Parameters.shadowBias");
            m_GenerateLightingData = serializedObject.FindProperty("m_Parameters.generateLightingData");
        }