Simple interactable rework
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Editor
|
||||
public class ItemPrefabEditorWindow : EditorWindow
|
||||
{
|
||||
private GameObject _selectedGameObject;
|
||||
private Interactable _interactable;
|
||||
private InteractableBase _interactable;
|
||||
private PickupItemData _pickupData;
|
||||
private PuzzleStepSO _objectiveData;
|
||||
private UnityEditor.Editor _soEditor;
|
||||
@@ -42,17 +42,17 @@ namespace Editor
|
||||
if (Selection.activeGameObject != null)
|
||||
{
|
||||
_selectedGameObject = Selection.activeGameObject;
|
||||
_interactable = _selectedGameObject.GetComponent<Interactable>();
|
||||
_interactable = _selectedGameObject.GetComponent<InteractableBase>();
|
||||
}
|
||||
else if (Selection.activeObject is GameObject go)
|
||||
{
|
||||
_selectedGameObject = go;
|
||||
_interactable = go.GetComponent<Interactable>();
|
||||
_interactable = go.GetComponent<InteractableBase>();
|
||||
}
|
||||
|
||||
if (_selectedGameObject == null || _interactable == null)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Select a GameObject or prefab with an Interactable component to edit.", MessageType.Info);
|
||||
EditorGUILayout.HelpBox("Select a GameObject or prefab with an InteractableBase component to edit.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user