Пример #1
0
        public void OnEnable()
        {
            m_ShowColliderTypeFoldout = new SavedBool("PhysicsDebugWindow.ShowColliderType", false);
            m_CurrentTab = new SavedInt("PhysicsDebugWindow.CurrentTab", 0);
            m_Collumns   = new SavedInt("PhysicsDebugWindow.Collumns", 1);

            SceneView.duringSceneGui                 += OnSceneGUI;
            Selection.selectionChanged               += UpdateSelection;
            EditorSceneManager.sceneClosed           += OnSceneClose;
            EditorSceneManager.sceneOpened           += OnSceneOpen;
            EditorApplication.playModeStateChanged   += PlayModeStateChanged;
            PhysicsDebugDraw.OnDrawPooledContacts    += DrawContacts_Internal;
            PhysicsDebugDraw.OnRetrievePooledQueries += OnQueriesRetrieved;
            PhysicsDebugDraw.BeforeSimulate          += BeforeSimulate;
            SetPickingEnabled(PhysicsVisualizationSettings.showCollisionGeometry &&
                              PhysicsVisualizationSettings.enableMouseSelect);

            LoadDictionary();
            ClearInvalidObjects();
            UpdateSelection();

            PhysicsDebugDraw.ClearAllPools();

            wantsLessLayoutEvents = true;
        }
Пример #2
0
        public void OnEnable()
        {
            var body = target as Rigidbody2D;

            m_Simulated = serializedObject.FindProperty("m_Simulated");
            m_BodyType  = serializedObject.FindProperty("m_BodyType");
            m_Material  = serializedObject.FindProperty("m_Material");
            m_UseFullKinematicContacts = serializedObject.FindProperty("m_UseFullKinematicContacts");
            m_UseAutoMass        = serializedObject.FindProperty("m_UseAutoMass");
            m_Mass               = serializedObject.FindProperty("m_Mass");
            m_LinearDrag         = serializedObject.FindProperty("m_LinearDrag");
            m_AngularDrag        = serializedObject.FindProperty("m_AngularDrag");
            m_GravityScale       = serializedObject.FindProperty("m_GravityScale");
            m_Interpolate        = serializedObject.FindProperty("m_Interpolate");
            m_SleepingMode       = serializedObject.FindProperty("m_SleepingMode");
            m_CollisionDetection = serializedObject.FindProperty("m_CollisionDetection");
            m_Constraints        = serializedObject.FindProperty("m_Constraints");

            m_ShowIsStatic.value = body.bodyType != RigidbodyType2D.Static;
            m_ShowIsStatic.valueChanged.AddListener(Repaint);

            m_ShowIsKinematic.value = body.bodyType != RigidbodyType2D.Kinematic;
            m_ShowIsKinematic.valueChanged.AddListener(Repaint);

            m_ShowInfo.valueChanged.AddListener(Repaint);
            m_ShowInfoFoldout = new SavedBool($"{target.GetType()}.ShowFoldout", false);
            m_ShowInfo.value  = m_ShowInfoFoldout.value;
            m_ShowContacts.valueChanged.AddListener(Repaint);
            m_ContactScrollPosition = Vector2.zero;
        }
        public virtual void OnEnable()
        {
            m_SortingOrder         = serializedObject.FindProperty("m_SortingOrder");
            m_SortingLayerID       = serializedObject.FindProperty("m_SortingLayerID");
            m_DynamicOccludee      = serializedObject.FindProperty("m_DynamicOccludee");
            m_RenderingLayerMask   = serializedObject.FindProperty("m_RenderingLayerMask");
            m_RendererPriority     = serializedObject.FindProperty("m_RendererPriority");
            m_MotionVectors        = serializedObject.FindProperty("m_MotionVectors");
            m_SkinnedMotionVectors = serializedObject.FindProperty("m_SkinnedMotionVectors");
            m_Materials            = serializedObject.FindProperty("m_Materials");
            m_MaterialsSize        = serializedObject.FindProperty("m_Materials.Array.size");

            m_ShowMaterials     = new SavedBool($"{target.GetType()}.ShowMaterials", true);
            m_ShowProbeSettings = new SavedBool($"{target.GetType()}.ShowProbeSettings", true);
            m_ShowOtherSettings = new SavedBool($"{target.GetType()}.ShowOtherSettings", true);

            m_Lighting = new LightingSettingsInspector(serializedObject);
            m_Lighting.showLightingSettings = new SavedBool($"{target.GetType()}.ShowLightingSettings", true);
            m_Lighting.showLightmapSettings = new SavedBool($"{target.GetType()}.ShowLightmapSettings", true);
            m_Lighting.showBakedLightmap    = new SavedBool($"{target.GetType()}.ShowBakedLightmapSettings", false);
            m_Lighting.showRealtimeLightmap = new SavedBool($"{target.GetType()}.ShowRealtimeLightmapSettings", false);

            m_Probes = new Probes();
            m_Probes.Initialize(serializedObject);
        }
Пример #4
0
        public void OnEnable()
        {
            m_Mass = serializedObject.FindProperty("m_Mass");
            m_ParentAnchorPosition  = serializedObject.FindProperty("m_ParentAnchorPosition");
            m_ParentAnchorRotation  = serializedObject.FindProperty("m_ParentAnchorRotation");
            m_AnchorPosition        = serializedObject.FindProperty("m_AnchorPosition");
            m_AnchorRotation        = serializedObject.FindProperty("m_AnchorRotation");
            m_ComputeParentAnchor   = serializedObject.FindProperty("m_ComputeParentAnchor");
            m_ArticulationJointType = serializedObject.FindProperty("m_ArticulationJointType");

            m_LinearX = serializedObject.FindProperty("m_LinearX");
            m_LinearY = serializedObject.FindProperty("m_LinearY");
            m_LinearZ = serializedObject.FindProperty("m_LinearZ");
            m_SwingY  = serializedObject.FindProperty("m_SwingY");
            m_SwingZ  = serializedObject.FindProperty("m_SwingZ");
            m_Twist   = serializedObject.FindProperty("m_Twist");

            m_XDrive = serializedObject.FindProperty("m_XDrive");
            m_YDrive = serializedObject.FindProperty("m_YDrive");
            m_ZDrive = serializedObject.FindProperty("m_ZDrive");

            m_LinearDamping  = serializedObject.FindProperty("m_LinearDamping");
            m_AngularDamping = serializedObject.FindProperty("m_AngularDamping");
            m_JointFriction  = serializedObject.FindProperty("m_JointFriction");

            m_Immovable  = serializedObject.FindProperty("m_Immovable");
            m_UseGravity = serializedObject.FindProperty("m_UseGravity");

            // Info foldout
            m_ShowInfo.valueChanged.AddListener(Repaint);

            m_RequiresConstantRepaint = false;
            m_ShowInfoFoldout         = new SavedBool($"{target.GetType()}.ShowFoldout", false);
            m_ShowInfo.value          = m_ShowInfoFoldout.value;
        }
 public void OnEnable()
 {
     m_ShowInfoFoldout         = new SavedBool("PhysicsDebugWindow.ShowFoldout", false);
     m_ShowColliderTypeFoldout = new SavedBool("PhysicsDebugWindow.ShowColliderType", false);
     m_ColorFoldout            = new SavedBool("PhysicsDebugWindow.ShowColorFoldout", false);
     m_RenderingFoldout        = new SavedBool("PhysicsDebugWindow.ShowRenderingFoldout", false);
 }
Пример #6
0
        public override void OnEnable()
        {
            base.OnEnable();

            m_Density = serializedObject.FindProperty("m_Density");

            m_ShowDensity.value = ShouldShowDensity();
            m_ShowDensity.valueChanged.AddListener(Repaint);

            m_ShowInfo.valueChanged.AddListener(Repaint);
            m_ShowInfoFoldout = new SavedBool($"{target.GetType()}.ShowFoldout", false);
            m_ShowInfo.value  = m_ShowInfoFoldout.value;
            m_ShowContacts.valueChanged.AddListener(Repaint);
            m_ContactScrollPosition = Vector2.zero;

            m_Material        = serializedObject.FindProperty("m_Material");
            m_IsTrigger       = serializedObject.FindProperty("m_IsTrigger");
            m_UsedByEffector  = serializedObject.FindProperty("m_UsedByEffector");
            m_UsedByComposite = serializedObject.FindProperty("m_UsedByComposite");
            m_Offset          = serializedObject.FindProperty("m_Offset");
            m_AutoTiling      = serializedObject.FindProperty("m_AutoTiling");

            m_ShowCompositeRedundants.value = !m_UsedByComposite.boolValue;
            m_ShowCompositeRedundants.valueChanged.AddListener(Repaint);
        }
Пример #7
0
        public void OnEnable()
        {
            m_BakeSettings = new LightingWindowBakeSettings();
            m_BakeSettings.OnEnable();

            m_ShowWorkflowSettings   = new SavedBool("LightingWindow.ShowWorkflowSettings", true);
            m_ShowProbeDebugSettings = new SavedBool("LightingWindow.ShowProbeDebugSettings", false);
        }
Пример #8
0
        public void OnEnable()
        {
            m_Constraints = serializedObject.FindProperty("m_Constraints");
            m_ShowInfo.valueChanged.AddListener(Repaint);

            m_RequiresConstantRepaint = false;
            m_ShowInfoFoldout         = new SavedBool($"{target.GetType()}.ShowFoldout", false);
            m_ShowInfo.value          = m_ShowInfoFoldout.value;
        }
Пример #9
0
 public void OnEnable()
 {
     m_ShowInfoFoldout         = new SavedBool("PhysicsDebugWindow.ShowFoldout", false);
     m_ShowColliderTypeFoldout = new SavedBool("PhysicsDebugWindow.ShowColliderType", false);
     m_ColorFoldout            = new SavedBool("PhysicsDebugWindow.ShowColorFoldout", false);
     m_RenderingFoldout        = new SavedBool("PhysicsDebugWindow.ShowRenderingFoldout", false);
     m_OverlayWindow           = new OverlayWindow(Style.physicsDebug, DisplayControls, (int)SceneViewOverlay.Ordering.PhysicsDebug, null,
                                                   SceneViewOverlay.WindowDisplayOption.OneWindowPerTarget);
 }
Пример #10
0
        public void OnEnable()
        {
            m_BakeSettings = new LightingWindowBakeSettings();
            m_BakeSettings.OnEnable();

            InitLightmapSettings();

            m_ShowOtherSettings      = new SavedBool("LightingWindow.ShowOtherSettings", true);
            m_ShowDebugSettings      = new SavedBool("LightingWindow.ShowDebugSettings", false);
            m_ShowProbeDebugSettings = new SavedBool("LightingWindow.ShowProbeDebugSettings", false);
        }
Пример #11
0
        private void OnEnable()
        {
            m_AnimationFrameRate = serializedObject.FindProperty("m_AnimationFrameRate");
            m_TilemapColor       = serializedObject.FindProperty("m_Color");
            m_TileAnchor         = serializedObject.FindProperty("m_TileAnchor");
            m_Orientation        = serializedObject.FindProperty("m_TileOrientation");
            m_OrientationMatrix  = serializedObject.FindProperty("m_TileOrientationMatrix");

            m_ShowInfo.valueChanged.AddListener(Repaint);
            m_ShowInfoFoldout = new SavedBool($"{target.GetType()}.ShowFoldout", false);
            m_ShowInfo.value  = m_ShowInfoFoldout.value;
        }
Пример #12
0
        public virtual void OnOpenGUI(Material material, MaterialEditor materialEditor)
        {
            // Foldout states
            m_HeaderStateKey        = k_KeyPrefix + material.shader.name; // Create key string for editor prefs
            m_SurfaceOptionsFoldout = new SavedBool($"{m_HeaderStateKey}.SurfaceOptionsFoldout", true);
            m_SurfaceInputsFoldout  = new SavedBool($"{m_HeaderStateKey}.SurfaceInputsFoldout", true);
            m_AdvancedFoldout       = new SavedBool($"{m_HeaderStateKey}.AdvancedFoldout", false);

            foreach (var obj in materialEditor.targets)
            {
                MaterialChanged((Material)obj);
            }
        }
        public void OnEnable()
        {
            m_Mode            = serializedObject.FindProperty("m_Mode");
            m_RefreshMode     = serializedObject.FindProperty("m_RefreshMode");
            m_TimeSlicingMode = serializedObject.FindProperty("m_TimeSlicingMode");

            m_Resolution           = serializedObject.FindProperty("m_Resolution");
            m_NearAndFarProperties = new[] { serializedObject.FindProperty("m_NearClip"), serializedObject.FindProperty("m_FarClip") };
            m_ShadowDistance       = serializedObject.FindProperty("m_ShadowDistance");
            m_Importance           = serializedObject.FindProperty("m_Importance");
            m_BoxSize              = serializedObject.FindProperty("m_BoxSize");
            m_BoxOffset            = serializedObject.FindProperty("m_BoxOffset");
            m_CullingMask          = serializedObject.FindProperty("m_CullingMask");
            m_ClearFlags           = serializedObject.FindProperty("m_ClearFlags");
            m_BackgroundColor      = serializedObject.FindProperty("m_BackGroundColor");
            m_HDR                  = serializedObject.FindProperty("m_HDR");
            m_BoxProjection        = serializedObject.FindProperty("m_BoxProjection");
            m_IntensityMultiplier  = serializedObject.FindProperty("m_IntensityMultiplier");
            m_BlendDistance        = serializedObject.FindProperty("m_BlendDistance");
            m_CustomBakedTexture   = serializedObject.FindProperty("m_CustomBakedTexture");
            m_RenderDynamicObjects = serializedObject.FindProperty("m_RenderDynamicObjects");
            m_UseOcclusionCulling  = serializedObject.FindProperty("m_UseOcclusionCulling");

            ReflectionProbe p = target as ReflectionProbe;

            m_ShowProbeModeRealtimeOptions.valueChanged.AddListener(Repaint);
            m_ShowProbeModeCustomOptions.valueChanged.AddListener(Repaint);
            m_ShowBoxOptions.valueChanged.AddListener(Repaint);
            m_ShowProbeModeRealtimeOptions.value = p.mode == ReflectionProbeMode.Realtime;
            m_ShowProbeModeCustomOptions.value   = p.mode == ReflectionProbeMode.Custom;
            m_ShowBoxOptions.value = true;

            m_BoundsHandle.handleColor    = kGizmoHandleReflectionProbe;
            m_BoundsHandle.wireframeColor = Color.clear;

            m_ShowRuntimeSettings        = new SavedBool("ReflectionProbeEditor.ShowRuntimeSettings", true);
            m_ShowCubemapCaptureSettings = new SavedBool("ReflectionProbeEditor.ShowCubemapCaptureSettings", true);

            UpdateOldLocalSpace();
            SceneView.beforeSceneGui += OnPreSceneGUICallback;

            for (int i = 0; i < targets.Length; ++i)
            {
                s_CurrentlyEditedProbes.Add((ReflectionProbe)targets[i]);
            }
        }
        public void OnEnable()
        {
            m_BakeSettings = new LightingWindowBakeSettings();
            m_BakeSettings.OnEnable();

            m_ShowWorkflowSettings   = new SavedBool("LightingWindow.ShowWorkflowSettings", true);
            m_ShowProbeDebugSettings = new SavedBool("LightingWindow.ShowProbeDebugSettings", false);

            string configDeviceAndPlatform = EditorUserSettings.GetConfigValue("lightmappingDeviceAndPlatform");

            if (configDeviceAndPlatform != null)
            {
                m_LightmapDeviceAndPlatform = Int32.Parse(configDeviceAndPlatform);
            }
            else
            {
                EditorUserSettings.SetConfigValue("lightmappingDeviceAndPlatform", "0");
            }
        }
Пример #15
0
        public override void OnEnable()
        {
            base.OnEnable();

            m_Density = serializedObject.FindProperty("m_Density");

            m_ShowDensity.value = ShouldShowDensity();
            m_ShowDensity.valueChanged.AddListener(Repaint);

            m_ShowLayerOverrides.valueChanged.AddListener(Repaint);
            m_ShowLayerOverridesFoldout = new SavedBool($"{target.GetType() }.ShowLayerOverridesFoldout", false);
            m_ShowLayerOverrides.value  = m_ShowLayerOverridesFoldout.value;

            m_ShowInfo.valueChanged.AddListener(Repaint);
            m_ShowInfoFoldout = new SavedBool($"{target.GetType()}.ShowInfoFoldout", false);
            m_ShowInfo.value  = m_ShowInfoFoldout.value;
            m_ShowContacts.valueChanged.AddListener(Repaint);
            m_ContactScrollPosition = Vector2.zero;

            m_Material              = serializedObject.FindProperty("m_Material");
            m_IsTrigger             = serializedObject.FindProperty("m_IsTrigger");
            m_UsedByEffector        = serializedObject.FindProperty("m_UsedByEffector");
            m_UsedByComposite       = serializedObject.FindProperty("m_UsedByComposite");
            m_Offset                = serializedObject.FindProperty("m_Offset");
            m_AutoTiling            = serializedObject.FindProperty("m_AutoTiling");
            m_LayerOverridePriority = serializedObject.FindProperty("m_LayerOverridePriority");
            m_IncludeLayers         = serializedObject.FindProperty("m_IncludeLayers");
            m_ExcludeLayers         = serializedObject.FindProperty("m_ExcludeLayers");
            m_ForceSendLayers       = serializedObject.FindProperty("m_ForceSendLayers");
            m_ForceReceiveLayers    = serializedObject.FindProperty("m_ForceReceiveLayers");
            m_ContactCaptureLayers  = serializedObject.FindProperty("m_ContactCaptureLayers");
            m_CallbackLayers        = serializedObject.FindProperty("m_CallbackLayers");

            m_ShowCompositeRedundants.value = !m_UsedByComposite.boolValue;
            m_ShowCompositeRedundants.valueChanged.AddListener(Repaint);

            m_RequiresConstantRepaint = false;
        }
Пример #16
0
 public void OnEnable()
 {
     m_ShowOtherSettings = new SavedBool($"LightingWindow.ShowOtherSettings", true);
 }
Пример #17
0
 public void OnEnable()
 {
     m_SRP = GraphicsSettings.currentRenderPipeline?.GetType();
     m_ShowOtherSettings = new SavedBool($"LightingWindow.ShowOtherSettings", true);
 }