public LODAction(List<LODGroupGUI.LODInfo> lods, float percentage, Vector2 clickedPosition, SerializedObject objectRef, LODGroupEditor.LODAction.Callback callback) { this.m_LODs = lods; this.m_Percentage = percentage; this.m_ClickedPosition = clickedPosition; this.m_ObjectRef = objectRef; this.m_Callback = callback; }
private static void SetLODLightmapScale(LODGroupEditor.LODLightmapScale lodRenderer) { foreach (SerializedProperty current in lodRenderer.m_Renderers) { SerializedObject serializedObject = new SerializedObject(current.objectReferenceValue); SerializedProperty serializedProperty = serializedObject.FindProperty("m_ScaleInLightmap"); serializedProperty.floatValue = Mathf.Max(0f, lodRenderer.m_Scale * (1f / LightmapVisualization.GetLightmapLODLevelScale((Renderer)current.objectReferenceValue))); serializedObject.ApplyModifiedProperties(); } }
private static void SetLODLightmapScale(LODGroupEditor.LODLightmapScale lodRenderer) { using (List<SerializedProperty>.Enumerator enumerator = lodRenderer.m_Renderers.GetEnumerator()) { while (enumerator.MoveNext()) { SerializedProperty current = enumerator.Current; SerializedObject serializedObject = new SerializedObject(current.objectReferenceValue); serializedObject.FindProperty("m_ScaleInLightmap").floatValue = Mathf.Max(0.0f, lodRenderer.m_Scale * (1f / LightmapVisualization.GetLightmapLODLevelScale((Renderer) current.objectReferenceValue))); serializedObject.ApplyModifiedProperties(); } } }