private Texture FindIcon(LaserLabObject obj) { if (obj is BoardObject) { return(boardObjectIcons[findIndex(boardObjectTypes, obj.GetType())]); } else if (obj is WallObject) { return(wallObjectIcons[findIndex(wallObjectTypes, obj.GetType())]); } return(null); }
private void DrawProperties(LaserLabObject obj) { SerializedObject serialObj = new SerializedObject(obj); SerializedProperty prop = serialObj.GetIterator(); GUI.enabled = false; prop.NextVisible(true); EditorGUILayout.PropertyField(prop); GUI.enabled = true; while (prop.NextVisible(true)) { bool isPrefabData = System.Attribute.GetCustomAttribute(obj.GetType().GetField(prop.name), typeof(PrefabDataAttribute)) != null; if (isPrefabData) { GUI.enabled = false; } EditorGUILayout.PropertyField(prop); GUI.enabled = true; } if (serialObj.ApplyModifiedProperties()) { if (obj is IRefreshable) { (obj as IRefreshable).Refresh(); } } }