public override void OnInspectorGUI() { var binaryBlueprint = ((BinaryBlueprint)target); EditorGUI.BeginChangeCheck(); { EditorGUILayout.LabelField("Blueprint", EditorStyles.boldLabel); binaryBlueprint.name = EditorGUILayout.TextField("Name", binaryBlueprint.name); EntitasEditorLayout.BeginHorizontal(); { _poolIndex = EditorGUILayout.Popup(_poolIndex, _allPoolNames); if (GUILayout.Button("Switch")) { switchToPool(); } } EntitasEditorLayout.EndHorizontal(); EntityDrawer.DrawComponents(_pool, _entity, true); } var changed = EditorGUI.EndChangeCheck(); if (changed) { binaryBlueprint.Serialize(_entity); AssetDatabase.RenameAsset(AssetDatabase.GetAssetPath(target), binaryBlueprint.name); EditorUtility.SetDirty(target); } }
public override void OnInspectorGUI() { var binaryBlueprint = ((BinaryBlueprint)target); EditorGUI.BeginChangeCheck(); { EditorGUILayout.LabelField("Blueprint", EditorStyles.boldLabel); binaryBlueprint.name = EditorGUILayout.TextField("Name", binaryBlueprint.name); if (_context != null) { EditorGUILayout.BeginHorizontal(); { _contextIndex = EditorGUILayout.Popup(_contextIndex, _allContextNames); if (EditorLayout.MiniButton("Switch Context")) { switchToContext(); } } EditorGUILayout.EndHorizontal(); EntityDrawer.DrawComponents(_entity); } else { EditorGUILayout.LabelField("No contexts found!"); } } var changed = EditorGUI.EndChangeCheck(); if (changed) { binaryBlueprint.Serialize(_entity); AssetDatabase.RenameAsset(AssetDatabase.GetAssetPath(target), binaryBlueprint.name); EditorUtility.SetDirty(target); } }
public override void OnInspectorGUI() { var BlueprintScriptableObject = ((BlueprintScriptableObject)target); EditorGUI.BeginChangeCheck(); { EditorGUILayout.LabelField("Blueprint", EditorStyles.boldLabel); if (_context != null) { EditorGUILayout.BeginHorizontal(); { _contextIndex = EditorGUILayout.Popup(_contextIndex, _allContextNames); if (_previousContextIndex != _contextIndex) { _previousContextIndex = _contextIndex; SwitchToContext(_contextIndex); } } EditorGUILayout.EndHorizontal(); EntityDrawer.DrawComponents(_context, _entity); } else { EditorGUILayout.LabelField("No contexts found!"); } } var changed = EditorGUI.EndChangeCheck(); if (changed || previousName != BlueprintScriptableObject.name) { previousName = BlueprintScriptableObject.name; //UpdateBlueprintLayout (); UpdateBlueprint(); EditorUtility.SetDirty(BlueprintScriptableObject); } }