Edit inspected level
This commit is contained in:
parent
359b193ddf
commit
f3977a9f91
2 changed files with 17 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ public partial class AdventureEditor : MarginContainer
|
|||
public override void _Ready()
|
||||
{
|
||||
EditorInterface.Singleton.GetInspector().PropertyEdited += OnInspectorPropertyChanged;
|
||||
EditorInterface.Singleton.GetInspector().EditedObjectChanged += OnResourceChanged;
|
||||
}
|
||||
|
||||
public void Reload()
|
||||
|
|
@ -45,4 +46,18 @@ public partial class AdventureEditor : MarginContainer
|
|||
HardReload();
|
||||
}
|
||||
}
|
||||
public void OnResourceChanged()
|
||||
{
|
||||
if (EditorInterface.Singleton.GetInspector().GetEditedObject() is AdventureLevelResource resource)
|
||||
{
|
||||
editedPath = resource.ResourcePath;
|
||||
HardReload();
|
||||
}
|
||||
}
|
||||
public override void _ExitTree()
|
||||
{
|
||||
EditorInterface.Singleton.GetInspector().PropertyEdited -= OnInspectorPropertyChanged;
|
||||
EditorInterface.Singleton.GetInspector().EditedObjectChanged -= OnResourceChanged;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue