private void DrawTypeSpecificFields(Unlock unlock) { if (unlock.GetType() == typeof(PackUnlock)) { DrawPackUnlock(unlock as PackUnlock); } }
private void DrawBaseUnlock(Unlock unlock, int index) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("X", GUILayout.MaxWidth(24))) { settings.unlocks.RemoveAt(index); return; } GUIStyle unlockHeader = new GUIStyle(); unlockHeader.fontStyle = FontStyle.BoldAndItalic; unlockHeader.fontSize = 16; unlockHeader.normal.textColor = Color.black; EditorGUILayout.LabelField($"{unlock.GetType().Name}", unlockHeader); EditorGUILayout.EndHorizontal(); unlock.unlockDescription = EditorGUILayout.TextField("Description", unlock.unlockDescription, GUILayout.MaxWidth(350f)); unlock.unlockPrefab = (GameObject)EditorGUILayout.ObjectField("Notification Prefab", unlock.unlockPrefab, typeof(GameObject), false, GUILayout.MaxWidth(350f)); EditorGUILayout.Separator(); DrawTypeSpecificFields(unlock); }