Ejemplo n.º 1
0
    static public void addLod(int index, SerializedObject serializedObject, int insertModel, float insertStartLod, string prefix)
    {
        SerializedProperty serializedProperty = serializedObject.FindProperty(prefix);

        PiXYZLoDSettingsEditor.insertAt(index, serializedObject, insertModel);
        serializedProperty.FindPropertyRelative("lodCurrentIndex").intValue = index;
        serializedProperty.FindPropertyRelative("lodSettingCount").intValue = serializedProperty.FindPropertyRelative("lodSettings").arraySize;
        if (insertStartLod >= 0f)
        {
            serializedProperty.FindPropertyRelative("lodSettings").GetArrayElementAtIndex(insertModel).FindPropertyRelative("startLod").floatValue = insertStartLod;
        }
        serializedObject.ApplyModifiedProperties();
        PiXYZSettingsEditor.saveEditorPref(serializedObject, prefix);
    }