private void OnEnable() { profile = this.target as DySkyProfile; string scriptLocation = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this)); string standardLocation = scriptLocation.Replace("/Editor/DySkyProfileEditor.cs", "/Profile/_Standard.asset"); standard = AssetDatabase.LoadAssetAtPath(standardLocation, profile.GetType()) as DySkyProfile; props = new List <SerializedProperty>(); values = new List <object>(); values_standard = new List <object>(); spaces = new List <float>(); foreach (var field in profile.GetType().GetFields(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.GetField | BindingFlags.Instance)) { props.Add(serializedObject.FindProperty(field.Name)); values.Add(field.GetValue(profile)); values_standard.Add(field.GetValue(standard)); var attrs = field.GetCustomAttributes(typeof(SpaceAttribute), false); spaces.Add(attrs.Length > 0 ? (attrs[0] as SpaceAttribute).height : 0); } standardHide = true; }
public void OnProfileChanged(DySkyProfile profile) { controller.profile = profile; }