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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using Interactions;
|
||||
@@ -124,7 +124,7 @@ namespace Editor
|
||||
private void CreatePrefab()
|
||||
{
|
||||
var go = new GameObject(_prefabName);
|
||||
go.AddComponent<Interactable>();
|
||||
// Note: No need to add InteractableBase separately - Pickup and ItemSlot inherit from it
|
||||
go.AddComponent<BoxCollider>();
|
||||
int interactableLayer = LayerMask.NameToLayer("Interactable");
|
||||
if (interactableLayer != -1)
|
||||
|
||||
Reference in New Issue
Block a user