public override void OnInspectorGUI() { serializedObject.Update(); EditorGUI.BeginChangeCheck(); { EditorFieldUtility.ReadOnlyComponentField(target as MonoBehaviour, this); EditorGUILayout.BeginHorizontal(); WereAllGonnaDieAnywayNew.InventorySystem.Inventory _target = (WereAllGonnaDieAnywayNew.InventorySystem.Inventory)target; EditorGUILayout.PrefixLabel("Game Data DB"); _target.db = EditorGUILayout.ObjectField(_target.db, typeof(GameDatabaseSO), true) as GameDatabaseSO; EditorGUILayout.EndHorizontal(); if (reorderableList != null) { reorderableList.Layout(); } } if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); } }
public override void OnInspectorGUI() { //base.OnInspectorGUI(); serializedObject.Update(); EditorUtility.SetDirty(target); EditorGUI.BeginChangeCheck(); { EditorFieldUtility.ReadOnlyComponentField(target as MonoBehaviour, this); EditorGUILayout.BeginHorizontal(); SourceDataItemSO _target = (SourceDataItemSO)target; EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Item Type"); _target.type = (ITEMTYPE)EditorGUILayout.EnumPopup(_target.type); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Item Icon"); _target.icon = (Sprite)EditorGUILayout.ObjectField(_target.icon, typeof(Sprite), true); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Item Weight"); _target.weight = EditorGUILayout.FloatField(_target.weight); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Days Worth Ratio"); _target.daysWorthRatio = EditorGUILayout.IntField(_target.daysWorthRatio); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Resource Priority"); _target.resourcePriority = EditorGUILayout.IntField(_target.resourcePriority); EditorGUILayout.EndHorizontal(); if (reorderableList != null) { reorderableList.Layout(); } } if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUI.BeginChangeCheck(); { EditorFieldUtility.ReadOnlyComponentField(target as MonoBehaviour, this); EditorGUILayout.BeginHorizontal(); GameDatabaseSO _target = (GameDatabaseSO)target; EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Citizen Base Prefab"); _target.CitizenBasePrefab = EditorGUILayout.ObjectField(_target.CitizenBasePrefab, typeof(GameObject), true) as GameObject; EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Resident Base Prefab"); _target.ResidentBasePrefab = EditorGUILayout.ObjectField(_target.ResidentBasePrefab, typeof(GameObject), true) as GameObject; EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Harvestpoint Base Prefab"); _target.HarvestpointPrefab = EditorGUILayout.ObjectField(_target.HarvestpointPrefab, typeof(GameObject), true) as GameObject; EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Global Info Provider"); _target.GlobalInfoProvider = EditorGUILayout.ObjectField(_target.GlobalInfoProvider, typeof(GlobalInfoProvider), true) as GlobalInfoProvider; EditorGUILayout.EndHorizontal(); if (ItemTemplateList != null) { ItemTemplateList.Layout(); } if (CreatureSpritePrefabList != null) { CreatureSpritePrefabList.Layout(); } if (CreatureDefaultStatList != null) { CreatureDefaultStatList.Layout(); } if (CreatureNamesList != null) { CreatureNamesList.Layout(); } if (CitizenMasterList != null) { CitizenMasterList.Layout(); } if (HarvestPointDataList != null) { HarvestPointDataList.Layout(); } } if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); } }