#Prefab Issue
1 messages · Page 1 of 1 (latest)
Here I'll explain how the tool works
in scene view
Basically I'm trying to spawn in some themed prefabs into the scene when I click this button in the inspector
For quick ability to change the theme of my scene
But all of the prefabs I'm spawning in through this editor script aren't blue
And any changes I make aren't detected by PrefabUtility.RecordObject
So I can't apply them to the prefab or whatever I'm meant to do
Changes I make to the original prefab are also not being set in my object in the scene
Ok here I think I explained that confusingly
This is two problems, the first second one was easy to solve, but the first issue is persistent
Yep
but it's not prefab?
Yeah
but the original you referencing is prefab?
I'm spawning a prefab but after it spawns it's no longer a prefab
yes
Ah I think I figured it out
I have to use PrefabUtility.InstantiatePrefab(GameObject), not Instantiate(), right?
yep
i just found the thread to it
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
Is there any way I'd be able to do that inside of my class?
Because as it currently stands my editor script tells my other script to instantiate
idk, classes init at runtime and have it own method
idk if it work just by wrap spawner in class
can i see it
I think I'm probably structuring my code really badly since I'm new to editor scripting, but here
What I'm trying to do is make this an editor script, but also able to work at runtime, which is why I have this second script
Which is the one that runs both during editor and runtime
I should probably restructure it so that I can just spawn in the decorations in the editor and scrap the runtime section, since it feels unnecessary
I think I can probably take it from here tbh
Thank you for your help and suggestions
Editor scripts are tough for me, lots of trial and error lol
Haha maybe, but talking it through helped me a lot
So thanks for listening
😄
I might use this chat to talk through some other issues I have as I make this an editor window
So be prepared lol
ofc
Do you know how I can make a field for GameObjects in a custom Editor Window?
like slot to put in the gameobject?
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
ObjectField is deprecated though, is there any newer way?