#↕️┃editor-extensions

1 messages · Page 59 of 1

visual stag
#

does your ObjectField say it can accept assets?

#

I mean, actually, Scene Objects

unborn bluff
#

I am using Editor.CreateEditor(component).OnInspectorGUI(); to render it.

visual stag
#

it might require that for some reason

#

Hrm, no idea then

#

can you serialize any value successfully? Or is it actually showing you the "can't drag" symbol

unborn bluff
#

No problem serializing. Its just that I can't drag any Transform into it.

#

I have to do it through the inspector

#

This is so strange, I have no trouble referencing assets from the project window.

#

Technically what is being drawn in the custom editor is a prefab residing in the project window, but because the prefab is opened in the prefab editor the components there are being intepreted as scene elements even though they are objects from the project window?

#

Because other Object fields does not work either

#

I am just very sure I had it working at some point, but not sure what I have done to break it.

quaint zephyr
#

How do I detect the presence of a scroll bar in the PropertyDrawer script? My custom property get's cut off when scroll bar appears, so I assume I need to detect it and "squeeze" contents at the edge more in.

visual stag
#

@quaint zephyr please don't cross-post. This channel is the correct place for these questions

quaint zephyr
#

Sorry about that, I usually don't, but recently my previous posts haven't been attended to and this channel been dead around these times 😛

visual stag
#

The provided rect should shrink if the scroll bar is present, I don't think you should have to do anything at all

quaint zephyr
#

So it's in the way I coded it then?

visual stag
#

perhaps, I'm not totally sure, but I think it should work fine

quaint zephyr
#

lol, I am writing for help because it isn't working fine 😛 I just screen shot and missed haha.

visual stag
#

yeah, it definitely works fine here, so it must be how you coded it

quaint zephyr
#

What would be a conventional way of coding things like this?

visual stag
#

just use the provided rect and it takes the scroll bar into account

quaint zephyr
#

And by provided Rect you mean the one passed in by OnGUI?

visual stag
#

yeah

quaint zephyr
#

Ok. Thanks, I'll see if I can refactor my code.

quaint zephyr
#

@visual stag Thanks man. It's working good now

quaint zephyr
#

Is there a way to get the GameObject from the PropertyDrawer?

visual stag
#

something like property.serializedObject.targetObject, don't quote me on the exact path names

#

that'll be the component/SO and not the gameobject, but you can take it from there

quaint zephyr
#

That's exactly right. I used that to get the component, however it does not inherit MonoBehaviour...

visual stag
#

how do you mean? just cast it to component and then get the GO from that

quaint zephyr
#

Can you show me an example?
This is an example of mine:

var customClass = fieldInfo.GetValue(property.serializedObject.targetObject) as CustomClass

But I can't go customClass.gameObject because CustomClass is not a child of MonoBehaviour.

#

if I do

GameObject go = property.serializedObject.targetObject as GameObject

go is null

visual stag
#

((Component)property.serializedObject.targetObject).gameObject

#

^will only work if the property is on a component, and will fail if the property is on an SO

quaint zephyr
#

Component in this case being my custom class script?

visual stag
#

no, Component is fine

quaint zephyr
#

Oh. Let me try.

#

My man! You're so smart!

unborn bluff
#

I need to be able to differentiate between a prefab and a prefab variant but I can't figure what method from the PrefabUtility class will do the trick. Anyone know which one to use?

#

And the second after I typed this, I went back to the PrefabUtility class and stumbled upon PrefabUtility.IsPartOfRegularPrefab which did the trick.

visual stag
#

There's a prefab talk pinned to this channel, slide 48 has the functions you want

unborn bluff
#

Is there a way of finding out what FBX Model a mesh is associated with? Something like FindFBXSourceForMesh(meshFilter.mesh)?

#

I just realised that Mesh derives from Object so I could just use GetCorrespondingObjectFromOriginalSource

weak bone
#

whats the difference between
Rect optionsRect = GUILayoutUtility.GetRect(10, 10);
and
Rect optionsRect = new Rect(0, 0, 10, 10);

unborn bluff
#

I stumbled upon another issue. PrefabUtility.GetCorrespondingObjectFromOriginalSource<Object>(meshFilter.sharedMesh); returns me the sub-object of a FBX and not the FBX itself:

waxen sandal
#

@weak bone GetRect reservers that place in the layouting system

#

So if you do GUILayout.Button afterwards it'll be below it

#

Rather than inside

weak bone
#

oh got it, thanks 😃

#

i display 2 input fields when a button is pressed , they appear at the bottom of available values displayed on the window , if i want the 2 input fields at the top... what should be done ?

visual stag
#

@unborn bluff just get the asset path using asset database. That's the root object

unborn bluff
#

@visual stag ah, correct.

minor herald
#

Does anyone have experience with using UIElements.MeshGenerationContext to draw something on an editor window?
if so is there a way to draw on top of the visual element instead of under it?

severe python
#

I cannot help you sadly

waxen sandal
#

Wouldn't the VisualElement that it is invoked for have a z-order or something?

minor herald
#

Not that I'm aware of.
I might have an idea on how I can bring them to the front.
Make a new visual element which will be at top of the visual tree hierarchy and use that visual element to generate the all the lines.
I will try that for now

waxen sandal
#

That sounds like how it'll work

minor herald
#

Looks like that worked🎆

severe python
#

Do you know how drawing order works in the visual tree?

#

Parents are drawn before children, siblings are drawn first to last in the parent

#

so if you want something to draw on top it needs to be a child of what you want to draw it ontop of, and/or the last child in the parent container

minor herald
#

Yeah that's what I figured

severe python
#

I donno why I said I can't help you, I got confused by the fact that you're using this mesh thing I haven't seen before

#

which looks really useful btw

minor herald
#

It is

#

Now my tool is IMGUI free XD

severe python
#

w00t

#

Death to IMGUI!

minor herald
#

Haha

severe python
#

oh hey, I think I mentioned VisualElements to you before, I should let you know that I've updated the repo and the examples

#

As far as I'm aware, everything just works now, and if you're doing custom inspectors, then the only thing you have to do is make a UXML file matching the name of the Component you're inspecting

minor herald
#

Cool I will take a look

severe python
#

I don't have a binding setup for things like buttons yet, but the system is greatly simplified now, basically you can just add ContentPresenter to anything, set its Binding Path and then you'll be able to automatically load templates by the typename, which works anywhere not just in inspectors

quaint zephyr
#

Custom Property Drawer. The values persist throughout Edit mode and Play mode. And they even persist if I Saved my scene and shutdown Unity and open it up again.
However, if I loaded Unity, changed the values (it doesn't trigger a asterisk near the scene to indicate it needs saving), so I can't "Save" the scene. And when I shut down Unity and restart it, the values revert to their previous state.

So the only way I can make sure they persist is if I made some change to the scene, like add an empty and remove it, and then I can save. Otherwise Saving without that asterisk, doesn't work either.

How can I "Save" the state of my values in the drawer without having to jump through this extra hoop?

#

And switching between scenes is the same thing as restarting unity. If scene wasn't able to be saved, values revert. If so, they persist.

tough cairn
#

is there a way to get a list of all open tabs / windows ?

#

I don't mind reflecting internal classes

waxen sandal
#

Resources.FindObjectsOfTypeAll<EditorWindow>?

gloomy chasm
#

Was about to say I feel like I saw that you could do it like that

short tiger
#

I don't think built-in windows use EditorWindow though

#

Maybe you don't need those

gloomy chasm
#

They do.

short tiger
#

I was just flipping through the CS reference repo for an unrelated reason and came across this comment about the GUIView class:
// This is what we (not users) derive from to create various views. (Main Toolbar, etc.)
https://github.com/Unity-Technologies/UnityCsReference/blob/1093ded90f95fcced185a7c61393438ce65c749f/Editor/Mono/GUIView.cs

gloomy chasm
#

That is like the toolbar with the play/pause, buttons, and the transform tools I believe.

#

I know that the hierarchy, scene, project, and inspector windows all derive from EditorWindow. So I assume they all do.

short tiger
#

That sounds right

severe python
#

I hope they can eventually jsut remove all the old IMGUI cruft and flatten the whole design

#

and then remove IMGUI from the code base, and pretend it never existed in the first place

#

because its the right thing to do

wanton kindle
#

Ah, I see you've had to put up with searching through several-thousand-line-long code files for the place to change that one label text, only to have it break something a few hundred lines away too

severe python
#

oh no, I never got that far, I saw IMGUI for what it was an build scaffolding to minimize the amount of shit I had to do and then still hated it every step of the way since I knew exactly what I was missing from this GUI experience

#

I've been a professional WPF developer for 10-15 years approx?

#

so I knew how easy GUI work could be, and that IMGUI was making everything way more difficult than it should be

wanton kindle
#

IMGUI was all I ever knew >.>

severe python
#

having said that, I've said it once, and I'll keep saying it, UIElements is ❤️

wanton kindle
#

^

severe python
#

I'm a huge fan of WPF/XAML/MVVM, and I think UIElements has the potential to be better, its very close

#

UIElements single handedly ended my hatred of CSS as well

short tiger
#

There's still value in immediate GUI, just not as much for anything production quality.

#

If there wasn't, then libraries like dear IMGUI wouldn't be so popular.

severe python
#

I mean, you can either get things done, or fight with a system that doesn't give you any convenience for layout

#

libraries for IMGUI are so popular because you had no choice but to use it, so everyone tries to get something that makes the experience not miserable

#

like NoesisUI which turned IMGUI into WPF

#

its like saying, people like Hospitals because they end up in them all the time

short tiger
#

So no one who uses IMGUI actually likes it?

#

Or don't know any better?

severe python
#

I'm not naïve enough to think no one likes IMGUI, I think many who like it don't have experience with something better and its what they are familiar with and so are suffering from a kind of Stockholme syndrome

#

I'm sure there are people out there who are experienced with UI frameworks and still like IMGUI

wanton kindle
#

being able to just say something like

if (button)
  DoThing();

is convenient for small stuff, but for full editor extensions it's awful

severe python
#

IMGUI makes certain programmatic problems simple, but IMO thats mostly because of alack of experience with good UI Framework Design patterns like MVVM or MVC

#

its just always easier to separate business logic from your display logic, and when you don't have the option to really do that, you don't

#

or you're someone like me who says "screw this" and then makes a framework that allows me to use MVVM or MVC like configurations

#

So yeah, i think people who like IMGUI overall just don't know better, I'm sure there are outliars who have the experience needed to make an informed opinion on why they prefer IMGUI over a more friendly framework

#

but if you've only used IMGUI and think its great, you just don't know why its bad

#

Take VisualElements for example.
I can make a UI for any Component in Unity with VisualElements that updates the value of fields and even has complex control where I need it, or completely custom layout

#

and that UI is literally only UXML

#

I can change the look without ever thinking about the acutal business logic of the thing I'm presenting

#

like if I want to customize Transforms look, I have the ability to do that by adding Resources\Templates\Transform.UXML

#

actually, woudl you like to see?

#

oh nm, we don't have streaming chans on here

short tiger
#

I hope you don't think I'm making the argument that IMGUI is just as good for any purpose. dear IMGUI is popular for someone who just wants to be able to change their debug keyboard shortcuts into a toolbar or menu.

severe python
#

I actually donno what Dear IMGUI is, this is the first time I've heard of it

#

the most popular frameworks though are the ones that make IMGUI vanish

short tiger
severe python
#

Noesis was popular enough to move off the asset store

short tiger
#

It's not a Unity asset

severe python
#

oh its a c++ lib?

short tiger
#

I'm not making the argument that Unity should keep its IMGUI implementation either.

severe python
#

okay, so point and case

#

"Dear ImGui is designed to enable fast iterations and to empower programmers to create content creation tools and visualization / debug tools"

#

this is the primary reason why IMGUI is bad

#

IMGUI's iteration time, is sinful

#

which makes it really hard to debug layout issues since it takes some 30 seconds to check out changes

short tiger
#

There's nothing stopping someone from being able to add hot reload into this, it would just have to be specific to the engine running it and couldn't be implemented into the library itself.

severe python
#

oh is this not for unity?

short tiger
#

That's what I said before

#

I'm talking about immediate mode GUI in general, not Unity

severe python
#

Sorry, I interpreted "Not a unity asset" as not on the asset store

#

oh I won't speak to in general, I only mean very specifically in unity

short tiger
#

Like I said

I'm not making the argument that Unity should keep its IMGUI implementation either.

severe python
#

Unity's system falls apart for a lot of reasons, it doesn't mean IMGUI as a concept is universally bad

#

Sorry If I was giving that implication. I don't have the experience to make that assertion, I've only experienced IMGUI inside Unity, and so my opinion is based entirely on that

#

it's possible if I used Dear ImGUI I'd like it, but I simply wouldn't know

short tiger
#

It's very similar syntax to Unity's IMGUI. It's more about the context you're using it in.

severe python
#

and importantly, Unity's IMGUI layout system is really hard to work with, so if they had better layout systems then it could make all the difference

#

if its very similar in form and function, while the iteration time would help a lot, I'd probably still find it aggravating to work with. Custom controls are non-trivial because of the way the event flow works

short tiger
#

I haven't used it extensively, but I wouldn't be surprised if the layout system is better.

severe python
#

I mean, its a pretty low bar to overcome

#

Sorry UT guys

short tiger
#

For someone who's just playing around with OpenGL directly, making a game engine or something like that, IMGUI can be very valuable.

severe python
#

Well, the issue for me would come down to templating and iteration

short tiger
#

Just being able to make a toolbar is already valuable.

severe python
#

with something like WPF or UIElements, I can make a look for a Vector2, then re-apply that easily everywhere. I can modify it whenever I want and not even be concerned about if its going to break any logic, because it simply cannot

#

which is a small example, but that setup builds on itself rapidly

#

I have a type with 3 vector3s, I just add 3 of that template to a new template, and bam I now have a display for that class, oh I got a class which has a list of the previous class? I just add an iterating disaplay container (ItemsControl in VisualTemplates or WPF) and send it values from the array, bam now I got a big complex ui with a bunch of layers that I can change generally and update easily en mass

#

I'm not sure I can overstate just how powerful and useful DataTemplating is when combined with a good SOC framework for UI

gloomy chasm
#

I agree, UIElements is great once you get used to it (coming from IMGUI). However I think it's biggest weakness, especially when compared to IMGUI, is in the case that you only want to make a very small editor, like simply add a button to the inspector or something. It requires a lot more work then IMGUI does to do.

wanton kindle
#

I wouldn't say a lot more work, if you're using only c#

if (GUILayout.Button(new GUIContent("Test))
  DoThing();
vs
root.Add(new Button(()=>DoThing()){text="Test"});
severe python
#

no it doesn't @gloomy chasm

#

You're going to make an IMGUI Container, and then call the base inspector call from within that

gloomy chasm
#

Idk why I never thought to do it like that. I stand corrected.

severe python
#

to be completely honest, this is a guess, but I see no reason why it shouldn't work

#

from what I recall it should just work

gloomy chasm
#

Both what you said and Legend seem like it would work.

severe python
#

My framework actually makes it more difficult surprisingly

#

that said, you could make a template that specifically adds stuff to the default inspector and is able to do so purely through instantiating uxml

patent pebble
#

Hey, is there a way to toggle grid snapping on and off through code?

#

I'm making a tool that needs this feature

#

but can't find where in the API is that functionality

tough cairn
#

@waxen sandal woah

#

that worked

#

used the same line but Object.Find... got 0 results back

#

resources give me valid output for some reason

#

thanks

onyx harness
#

Object & Resources are different. That's why.

severe python
#

Yeah, but why would resources return editor windows that currently exist?

#

I thought it was only for loading things out of Resources folders

short tiger
#

Unity uses the Resources class for keeping static methods related to in-memory asset stuff

#

There's also Resources.UnloadAsset which can be used to unload any asset, not just ones loaded through Resources.

onyx harness
#

Resources accesses entities from both Runtime & Editor, not just runtime.

short tiger
#

The runtime is in the editor too, so I'd call running in playmode in the editor as runtime too

onyx harness
#

I understand you are still talking about runtime (in or out of Editor)

#

I am stating that Resources gives access to any created Object

#

(EditorWindow and such included)

short tiger
#

Yeah, you're right. I changed it to in-memory assets rather than runtime assets.

#

Because it won't give you access to assets in a build unless they've been loaded into memory.

#

And I guess the word asset is also not accurate.

#

They really shouldn't have stuffed all this into Resources.

pure sand
#

Is there a way to make a custom component move to the top in the inspector when added?

onyx harness
#

Yes

#

Reset()

#

And use the Component utility

onyx harness
#

@pure sand

pure sand
#

I think I've got it figured out now, thanks for the tips.

tough cairn
waxen sandal
#

You can do better than that 😛

tough cairn
#

custom skins ?

waxen sandal
#

If you want better scaling

tough cairn
#

what is that ...

#

🧐

waxen sandal
#

Custom skins is not that hard either

severe python
#

with UIElements UI Toolkit custom skins should be a trivial matter

tough cairn
#

interesting thing that GUI.matrix

#

where in the gif above its scaling the whole editor

#

( increasing the font sizes to be more precise )

waxen sandal
#

Yeah but you can change the scaling of other editor windows if you do reflection magic

tough cairn
#

@waxen sandal not sure i am missing something but there is no matrix in EditorWindow

#

https://github.com/Unity-Technologies/UnityCsReference/blob/1093ded90f95fcced185a7c61393438ce65c749f/Editor/Mono/EditorWindow.cs

waxen sandal
#

You're not but that doesn't mean you can't fix it 😉

tough cairn
#

do you mean to say there is a way to extend an existing method in C# ?

#

sort of code injection ?

severe python
#

I don't feel like thats what he's suggesting, but I donno what else he would be suggesting

#

you can, with mono.cecil

waxen sandal
#

It kind of is what I'm suggesting

#

But was intentionally being vague to let him research it on his own 😛

#

And with UIToolkit it's pretty easy to do better scaling as well

#

IT's also not hte only way to edit methods

severe python
#

tbh, I think the best approach is going to be through UI Toolkit's USS files now, hopefully you can dot hat

#

tbh, I think this whole editor skin for "pros" thing is stupid

#

like, straight up dumb

waxen sandal
#

I've managed to "hack" the editor to let you get the dark skin for free by manipulating editor styles 😛

severe python
#

lol, I'm pretty sure thats the standard among the community, hack the client to get the skin

#

I'll just make something to replace all the editor styles

waxen sandal
#

Well lots of people just edit the exe

severe python
#

build my own theme engine

#

it wont work completely though, they haven't migrated over to 100% uielements

waxen sandal
#

I've thought about that but it was too much effort 😛

severe python
#

its not worth the effort yet imo

#

I wonder if they'd let you deploy a theme manager to the asset store

waxen sandal
#

Well

severe python
#

I feel like the answer is no, and that is really dumb

#

simply because they positioned the theme as a pro feature for some hairbrained reason

waxen sandal
#

I did have permission from Caitlyn to publish my "hack" but then when I actually did it was declined 😦

severe python
#

I donno who Caitlyn is (I donno any of their names tbh)

waxen sandal
#

She used to be the Asset store manager

severe python
#

I know who a few of the UI toolkit guys are on the forums by their forum name

waxen sandal
#

Or w/e her title was

slim patrol
#

@waxen sandal you should publish your "hack" on github, so people can add it through the Package Manager 😄

waxen sandal
#

I doubt it works all that well anymore

#

And it's on the edge of being breaking the TOS

slim patrol
#

slap a Disclaimer and move on 😛

waxen sandal
#

Yeah rather not kill my career 😉

severe python
#

can we start a petition for them to pull their heads out of their rumps with the theme?

waxen sandal
#

Isn't there one?

severe python
#

honestly, locking a theme behind pro stifles the community innovation

#

and really, makes it so that we can't have a global theme manager allowing people to build blendable themeable extensions

#

perhaps that will be changing when they finish up their migration to UIElements

waxen sandal
#

Yeah they've seemed to be a more open nowadays so it wouldn't surprise me all that much

tough cairn
#

woosh

gilded condor
#

Hi there, I dont know if I'm in the right chan but I try to record video with cam-recorder and I get this error msg :
FMOD failed to switch to output recorder ... : "An invalid object handle was used. " (36)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
We are using Wwise and not the unity audio engine :/

weak bone
#

Can Event.current in editor scripting detect multiple inputs at the same time ?

#

If I want to spawn object after a button is being pressed (on hold) and a mouse click.
EventType don't contain a definition for KeyStay it only has KeyUp and KeyDown.
What can be done to achieve this mechanic?

waxen sandal
#

Set somethign to true on key down

#

And to false on key up\

wanton kindle
#

Anyone know a typical way of implementing "selectable" stuff and having it work with USS without having to bend over backwards? I saw the "selected" pseudo-state is apparently unused...

#

Apparently there's special handling for Toggles, but it only works with Toggles according to the docs

plush silo
#

Not sure if this is the right place to ask but does anyone know of a way to build single asset bundles seperately?

#

currently i have this little class that lets me build all asset bundles in one click

#

but whenever I do it I have to copy and paste backups of all the old assets I deleted back into the project otherwise the existing asset bundles will be overwritten with nothing

gilded condor
#

nobody use Unity Recorder combine with Wwise ???

steady crest
#

hmm, how would I create a prefab without having to create a gameobject in the scene? I have a collection of SO that are managing data but I need to add some functions to them from an interface. afaik its not possible to add functions to scriptable objects, so I create prefabs that reference the objects and update their data whenever a change is made

waxen sandal
#

You can add methods just fine to a SO

#

Just not add components

steady crest
#

I didnt mean methods internaly in the script. I mean unityevents actually @waxen sandal

#

im aware I cant add components, since they arent a monobehaviour

waxen sandal
#

They technically are monobehaviours but lets not get into that

#

Not sure you're able to create a prefab without a GO in the scene

#

But you can write a script that creates one for a bit and then destroys it after you created your prefab

steady crest
#

that is true, I could solve it like that. or I could look into generating the actual prefab asset file? or is that overkill?

waxen sandal
#

Probably overkill and you might end up generating something that only works in the current version of Unity

steady crest
#

good point, if the prefab system changes that code might stop working

onyx harness
#

Unity is suppose to correctly migrate between the different serializers

split bridge
#

Jusy FYI there’s also a concept of using ScriptableObject assets as events (similar to how the Timeline signals work) which can be a nice way to bridge SO assets and monobehaviours

waxen sandal
#

@onyx harness I'd assume that is only run on project upgrade rather than on import of assets?

steady crest
#

i havent heard about that @split bridge do you have any resources on that?

onyx harness
#

I think it is on save @waxen sandal

waxen sandal
#

Ah, then it probably won't be an issue

onyx harness
#

Because you can easily import old prefab into recent version

waxen sandal
#

Yeah that makes sense

#

I still wouldn't rely on it though

#

Kinda hacky imo

split bridge
#

There’s a great talk by Ryan Hipple which I’ll try and link but you can also try googling creating events with Timeline

steady crest
#

fair enough, that should be enough info to find it

#

ah there it is

waxen sandal
#

I've got a repo that implements the scriptable object architecture that he describes

#

But it's a bit outdated

#

Made in 2017.2 iirc

steady crest
#

gonna try and see to figure it out myself 😄 I would like to know how it functions more so than just using it

waxen sandal
#

Sure but it's open source so you can just look at the source 😛

steady crest
#

that would also work lol

onyx harness
#

If you have any question, you have this Discord

split bridge
#

Yea the concepts in that talk are quite dense - for your purposes basically all it would be is a new type of SO with a few methods - something like ‘register’ and ‘unregister’ calls which populate a static array. Then an invoke method which invokes all corresponding actions in the array. Smth like that.

steady crest
#

that makes sense, wonder if i can do that with unityevent properties. or should i just be using delegates and make a selector for my own functions? I would want to constrain it so only applicatable functions can be assigned

onyx harness
#

UnityEvent should work as well

#

They have the same purpose

steady crest
#

they do but I want to only show my functions in a selector, which is not something you can do in a unityevent selector

onyx harness
#

You can

#

Just write a PropertyDrawer

steady crest
#

like if i make a static class that has 5 functions that can be assigned to the SO event, can i make it o the unity event only sows those 5

#

oh

#

fair enough

onyx harness
#

It is possible

#

How do you know the 5 functions from?

steady crest
#

they are static void functions in a static class, and I would like my SO unityevent to only show those

onyx harness
#

Yes, it's possible

#

A PropertyAttribute, or an Editor

steady crest
#

you mean an attribute on the functions that allows them to be shown for the selector, correct?

#

I havent rly worked a lot with propertydrawers so i should do some research on those. @onyx harness

onyx harness
#

you mean an attribute on the functions that allows them to be shown for the selector, correct?
@steady crest it's a way

#

I havent rly worked a lot with propertydrawers so i should do some research on those. @onyx harness
@steady crest do and then ask in here

#

I will wait for your request brave adventurer

steady crest
#

fair enough, doesnt rly make sense asking questions before doing my own research 🙂

onyx harness
#

Because my realm is Editor only

minor herald
#

Does anyone know something about this error message?

NullReferenceException:Object reference not set to an instance of an object
UnityEditor.DockArea:OnEnable()

Googling this message doesn't really provide me with much info and the console doesn't provide any info about which line it happened

waxen sandal
#

Probably Unity fucking up somewhere

#

I've seen very similar ones come across

minor herald
#

Yeah it's been happening for quite a while now

split bridge
#

Occasionally it's worth resetting your layout - i.e. Window->Layouts->Default

minor herald
#

Just did and the message popped a few seconds afterwards

split bridge
#

Well if it doesn't happen in a blank project I guess at least you know it's likely from your or a 3rd party assets' code somewhere 😅

waxen sandal
#

Yeah it's probably caused by something in your project, it's just impossible to track down what 😛

split bridge
#

that's what source control and the delete key are for 🤣

minor herald
#

Yeah I know that is was caused by my code.
I will see if I can track down what it is

split bridge
#

Ah ok - well just in case it helps - sometimes there's a little more in the editor log to help track it down (Console->Hamburger->Show Editor Log)

severe python
#

@waxen sandal where is that repo, I'd like to take a look

waxen sandal
#

Lemme DM you, don't want to paste my private stuff all over this Discord 😛

#

Ehh, you gotta add me 😛

severe python
#

Does my posting of my private stuff all over discord bother you 😛

waxen sandal
#

Not at all 😛

#

I just don't want to have my shitposting be linked to my professional github

severe python
#

lol

#

I fear nothing!

#

Other than the realization that I'm a terrible programmer

grand saddle
#

Anyone know if there's a way to draw a custom Editor/Inspector when nothing is selected?

lucid hedge
#

How do I make my custom inspector remember foldout state?

#

editor prefs?

grand saddle
#

I'm usually writing into a static variable or a private field of the Editor

lucid hedge
#

Ah cool that works

#

thanks

severe python
#

If you're using UIToolkit (The framework formerly known as UIElements) then you're looking at View Data Keys

lucid hedge
#

I'm not but actually I will maybe convert my UI to it! Thanks

severe python
#

If you'd like to, I love it, and am happy to help others get going with it

visual stag
#

@lucid hedge SerializedProperty has an .expanded field, you generally highjack that

lucid hedge
#

@severe python I've only used UI Elements for editor windows

#

or well UI Toolkit

#

never for inspectors

#

and @visual stag uhh I'm using it like this

severe python
#

The toolkit formerly known as UIElements

lucid hedge
#

but using 'private static' for that variable 'showInteractionSettings' worked

#

and yeah haha I prefer UI Toolkit honestly

severe python
#

I just wish they could completely sunset the old systems because its honestly confusing at this point

#

I understand that thats not feasible or even reasonable, I just wish it was

#

I wonder if they include UI Builder in as part of the "UI Toolkit"

visual stag
#

I'm not sure how the context of the code helps. If you have access to a SerializedProperty you can use the .expanded field and save it as usual

lucid hedge
#

I'll look it up

keen pumice
#

I’m using EditorGUILayout.BeginHorizontal(); and EndHorizontal(). I want a space of a specific pixel width, between some EditorGUILayout controls in this horizontal section. But calling EditorGUILayout.Space(3,false); puts a space far larger than 3 pixels into the section.
I tried to find weather or not the “width” parameter specifies pixels or some other units. But I don’t even SEE a variant/overload of the Space function that takes ANY parameters in the docs (I found the overloads via VisualStudio intellisense). https://docs.unity3d.com/ScriptReference/EditorGUILayout.Space.html
Is it possible to specify a specific horizontal space size with EditorGUILayout? If so, what am I doing wrong.

severe python
#

I'm trying to setup a project for people to download, and I want to launch a setup when the project starts based upon whether or not a DLL exists in a specific folder.
If I wanted to do this, what options are there for executing a piece of code when the project opens?

#

nevermind, I remember, InitializeOnLoad

onyx harness
#

@keen pumice use GUILayout.Space

keen pumice
#

@onyx harness alas, I get the same huge horizontal offset with GUILayout.Space(3);

onyx harness
#

Show your code

#

Screenshot as well

severe python
#

Aw crap. I have an issue, need some guidance on this one I have no clue how I could do this

#

I have a library from a game that I depend on, but obviously I can't ship my code with that games library, so the user has to supply it themselves. I wanted to make this easy by checking to see if the library is in the project's assets and then opening a file dialog for the user to load the file into the project with.
The problem is my code wont compile without that library, so I need to conditionally compile that code based upon whether or not that library is present.
Is there any way to even do that?

waxen sandal
#

Is this in the editor?

#

If so when you launch Unity the first time it does a different compile

#

Rather than failing everything if there is an error anywhere

#

It'll try to compile each asmdef separately

#

So things like the PackageManager and code tool integrations still get compiled

severe python
#

so If I restart Unity, it should do it

#

lemme try that

#

I did section off the auto-config into its own assembly thinking that might resolve it

#

haven't restarted unity however

waxen sandal
#

Yeah that should work if it doesn't depend on that library

severe python
#

w00t

severe python
#

er, that means it worked

keen pumice
#

@onyx harness creating a simplied example GUILayout.Space(3); DOES work properly, even though EditorGUILayout.Space(3); doesn't. So, obviously I'm doing something else wrong in my non-example to get diff results - thanks for the tip! By the way.. any idea WHY it only works with GUILayout version and the EditorGUILayout version doesn't?

onyx harness
#

Dunno, I never used the Editor version

severe python
#

okay, is there a way to change the settings on an assembly file, the meta data

keen pumice
#

The problem is my code wont compile without that library, so I need to conditionally compile that code based upon whether or not that library is present.
Is there any way to even do that?
@severe python one option would be to put that particular set of code into it's own dll. meaning-- YOU compile it, and distribute that, rather than source code (so the user of your software does not need to compile it).

#

(I see you got an answer to this already, just wanted to present a different option)

severe python
#

I'm actually getting things setup for a compiled release version of my project, but I want the source code based version to work as well for those who want that environment, whatever the reason may be

#

So that part is all taken care of now, I can have a dialog open to copy in and configure the libraries when the project loads

#

Now, I need to build an export pipeline, which is just constructing AssetBundles from some data in the class.
Does the programmatic AssetBundle interface deal with dependencies, or is that specifically a feature of the AssetBundle Browser?

#

nm, I can look that up

onyx harness
#

okay, is there a way to change the settings on an assembly file, the meta data
@severe python SerializedObject

severe python
#

?

#

I solved it by just writing the meta file completely when I pulled in the assembly

#

but I don't understand why you mention SerializedObject

onyx harness
#

Manually writing a meta is not a sustainable way

severe python
#

all I want to do is turn off Validate References and Auto Reference for the assembly because its not necessary, is there a way to do that?

#

this is how I'm doing it currently

onyx harness
#

I never tried that before, but I guess there should be an easy way

severe python
#

ts good enough for now, the game is on 2018.4 LTS and probably isn't going to be changing versions, so I don't suspect an issue

onyx harness
#

UnityEditor.PluginImporter is the importer used, it should contain the data you requested

severe python
#

ahh, thank you

#

hmmm, don't really understand how to make use of that

#

nm, got it, htanks

#

Actually that doesnt seem to provide this. The only thing that appears to fit would be, setEditorData, but using it doesnt so anything

onyx harness
#

you have DefinesConstraints and isPreloaded that are public

#

but IsExplicitlyReferenced & ValidateReferences are internal

#

but to be honest, in this case, I would prefer to use SerializedObject

#

And iterate using a SerializedProperty to set the data

severe python
#

not sure this works

onyx harness
#

In my opinion, SerializedObject is the most reliable way of altering any Object

#

But to be honest

severe python
#

yeah, when I try to new up a SO on the importer it just blows up

onyx harness
#

ts good enough for now, the game is on 2018.4 LTS and probably isn't going to be changing versions, so I don't suspect an issue
@severe python If it works, it works

#

don't bother yourself with alternative technique

#

As you stated, you are going to stick to one version

#

You don't wrap the importer, but the asset itself (in your case, your assembly)

severe python
#

so that was my original intention, but I have no idea how to get the asset honestly, and that feels dumb

#

maybe I'm just convoluting this in my head

unborn bluff
#

Is it still true that there are no serializable [Flags] Enum that is visible in the inspector?

onyx harness
#

Where is the asset humanly speaking?

unborn bluff
#

Like with LayerMask?

severe python
#

Assets/Assemblies/Assembly-CSharp.dll

onyx harness
#

In Assets? O_o

severe python
#

if you mean because its Assembly-CSharp, its a modding situation

#

If not, I don't understand and feel I should be educated on why I'm stupid

onyx harness
#

You just do AssetDatabase.LoadObjectAtPath<Object>("Assets/Assemblies/Assembly-CSharp.dll")

#

Anything is an Object

#

Any asset is an UnityEngine.Object at the very base

#

You can't work with an Object. But a SerializedObject can.

#

A little helper to debug a SerO:

public static void    OutputHierarchy(this SerializedObject so)
{
    SerializedProperty    it = so.GetIterator();

    while (it.Next(true))
        PrintProperty(it);
}

private static void    PrintProperty(SerializedProperty it)
{
    if (it.propertyType == SerializedPropertyType.String)
        Debug.Log(it.propertyPath + " " + it.stringValue);
    else if (it.propertyType == SerializedPropertyType.Integer)
        Debug.Log(it.propertyPath + " " + it.intValue);
    else if (it.propertyType == SerializedPropertyType.ObjectReference)
        Debug.Log(it.propertyPath + " " + it.objectReferenceInstanceIDValue, it.objectReferenceValue);
    else
        Debug.Log(it.propertyPath + " " + it.propertyType);
}
severe python
#

yeet

onyx harness
#

There are things that are kept hidden.
To display them, you must set the mode of the SerO to internal instead of normal (Through Reflection)

severe python
#

the InspectorMode?

onyx harness
#

This one: inspectorMode = InspectorMode.DebugInternal

#

Yep

#

but use this one only if you really need hidden stuff

#

otherwise just do your things

#

hidden stuff like m_Script and such

severe python
#

meh, that doesn't work for me, I'm probably making a mistake, but screw it I'm just gonna use the ahrd coded setup

short venture
#

Is there any documentation for the Experimental.UIElements.GraphView other than the API reference?

visual stag
#

There's a tutorial pinned to this channel (not official)

whole steppe
#

anyone got vsc extensions for hints/autocompletions in unity?

stark geyser
#

@whole steppe The channel is about extending the editor. You are looking for VSCode Editor support package in the Package Manager.

whole steppe
#

oh alright, thank you

short venture
#

@visual stag Thanks, that helped a lot, much better than nothing

lucid hedge
#

using an EditorGUILayout.PropertyField

#

is it possible to control the spacing? So there is enough room for the text

short tiger
#

@lucid hedge Maybe increase EditorGUIUtility.labelWidth before drawing the field?

lucid hedge
#

That seems to do the trick! thanks

whole steppe
#

Does anyone know if it's possible to enable the rect tool for a custom script and get callbacks when the value changes?

opaque harness
#

I'm looking to basically generate paths from my own custom system, not using splines, can anyone point me to what I can use to be able to display them in the editor? For debugging purposes, paths that are basically just Vector3 points connected by a List or array.

analog rune
#

Heyo everyone!
Is there a way of changing an AnimatorController NOT during runtime via scripts?

Current code, that falls apart as soon as I play the scene:

public static void AppendController(AnimatorController controller, AsepriteImporterInstance importerInstance)
{
  Animator potentialPreviousAnimator = importerInstance.TargetObject.GetComponent<Animator>();
  if (potentialPreviousAnimator == null) importerInstance.TargetObject.AddComponent<Animator>();
  Animator animator = importerInstance.TargetObject.GetComponent<Animator>();
animator.runtimeAnimatorController = controller;        
}
waxen sandal
#

IIRC there is an editoranimatorcontroller

#

Oh apparently not

split bridge
#

@whole steppe what is the rect tool? Do you mean a Monobehaviour that has a Rect field?

#

@opaque harness you can look into Debug.DrawLine or Gizmos or Handles depending on what UI you're after

whole steppe
#

@split bridge it's one of the editor tools along the top of the screen (like translate, rotate, etc), it provides a manipulable rectangle

#

with a 3d cube selected you can use it to resize the cube, which is pretty handy. I'd like to be able to do this with some script components as well

#

for example to resize a tile grid

split bridge
#

ah that one - I'm 99% sure it's possible but I don't know the syntax off the top of my head

analog rune
#

@waxen sandal yeah, hence the issue. It's a bit silly that you can't make editor tools that change animatorControllers on objects. I mean, I added a prefab object onto this tool and it worked---sometimes?
I'm not 100% sure on what's the fix. And googling didnt help 😐

analog rune
#

Resolved, sort of:
Works if the target object is a prefab, but not if it's a scene object

blissful burrow
#

does anyone know if there's a callback on specific serialized objects when an undo state is applied to them?

#

I have a thing that needs to match the state of serialized properties, and it works in general except I don't know how to detect when you undid something on it

split bridge
#

@blissful burrow Undo.undoRedoPerformed I think is what you'd need? 🙂 - If it's just for specific SOs I guess you'd have to check within that editor-level callback

blissful burrow
#

I want to avoid having that be called for potentially hundreds of objects in my scene

#

I feel like there has to be a per-object callback, somehow, or a cheap way to detect it

split bridge
#

hm not that I know of - report back if you find something? Guessing you can't catch the modification at the point that they are modified?

#

if that makes any sense 😅

blissful burrow
#

mmmmmmaaaaybe but the location of that gets, messy. I can't have a static list, since that'll get dumped if you recompile your code and then undo to a state before that

#

so I'd need to serialized the pointers to what objects were modified

#

and how many times

#

:c

#

I guess I might just update all for now, just feels scary to just, do all the things in the scene

#

oh right heck I already have a solution for this

#

theoretically I should just make it match the data in OnValidate

#

since that is called after an object has something undone

#

but!

#

there's a bug (I think?) in Unity where assigning to a mesh filter in OnValidate throws a really weird warning about how SendMessage isn't allowed

#

this lil hecker

split bridge
#

That's a nuisance

blissful burrow
#

it's super weird

split bridge
#

Maybe have to resort to a delayedcall?

split bridge
#

sorry not being v helpful and gtg.. good luck!

blissful burrow
#

no you're fine! thanks for the help

#

not sure if I should hack around it or leave it there and just deal with all support messages by linking it to a bug report for Unity 🙃

stark geyser
blissful burrow
#

ah geez, that's gross :c

#

thanks for the link though, might help

#

why do I have to do this unity pls

#

having hundreds of in-editor update loops to fix this seems like a nightmare

stark geyser
#

People may go to extremes to have clean logs 😄

blissful burrow
stark geyser
#

I want to try to test if the execution can be outsourced to Editor supported Coroutines instead of the Update to run just once and avoid running things inside OnValidate. (without triggering the message)

#

If coroutine is being started by OnValidate it throws the same message. Otherwise it works just as well as Update when it already runs 😦

#

Ha! It works if you skip one first frame.

rancid cave
#

I'm looking to make an editor script that automatically unpacks prefabs completely when I drag them into the scene, does anyone know where I'd even begin?

#

I know I can have a script constantly running that detects and unpacks them, but ideally I'd want to hook on to the function that runs when a prefab is dragged into the scene. I just don't know how possible that is.

short tiger
#

@rancid cave There's the EditorApplication.hierarchyChanged event, but unfortunately it won't tell you what changed

deep lava
#

Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
Just installed it at https://www.microsoft.com/en-us/download/details.aspx?id=55168

I still get the error

Microsoft

Download archives for all versions of .NET - past and present. Get downloads for all versions of .NET Framework and .NET Core for Linux, macOS, and Windows.

stark geyser
deep lava
#

@stark geyser Oh, I thought it was about it, sorry

wanton kindle
#

anyone happen to know how to get a VisualElement's rect to be centered about its transform position?

onyx harness
#

Does someone know where to find the background color of the Editor?

real ivy
#

Is it possible to maximize the game window? As in, no border kinda max?

severe python
#

shift space?

visual stag
#

feels like they're all a bit hacky

severe python
#

I'd imagine it works something like, they drill down with reflection to the tab, undock the tab, use win32 to get the window, then full screen it?

#

nah, theres got to be a bit more to it

civic lotus
#

@onyx harness you mean ^ ?

silver spruce
#

I migrated my project from Unity 2018.3 to 2019.3.7f... Every single UnityEvent in my project throws errors that the UnityEventDrawer has a problem with a null pointer exception

#

Any idea why this happens and how i can fix this ?

#

Would be great if anyone could post their EventDrawer... probably mine wasnt upgraded

split bridge
#

restart Unity before doing anything else - sometimes upgrading can temporarily cause references to be lost @silver spruce

silver spruce
#

@split bridge did that several times... still that EventDrawer issue :/

#

Could really need some help with this here, my whole app is pretty UI Heavy and now all Events are invisible due to the EventDrawer

split bridge
#

oh I just more closely looked at your code - trying to process how that's supposed to be working - 1 sec

silver spruce
#

@split bridge Thanks ! Actually not my code... this is the part of the UnityEventDrawer which throws the exception

split bridge
#

hmm that's really odd

#

my guess is that 'prop' is null when passed to that method but I have no idea why - I suggest looking at the stack trace and trying to work your way back through the code - also this probably belongs in #💻┃code-beginner or #💻┃unity-talk perhaps

silver spruce
#

@split bridge Thanks ! They say i should properly delete my library folder for generating new librarys ^^ im gonna give that a try

stark geyser
#

@oak grotto Don't cross-post, this has nothing to do with extending the editor.

silver spruce
#

@stark geyser So i deleted the whole library folder... reopened the project... and the issue is still here :/ its getting weird

stark geyser
#

What is the component not being displayed?

silver spruce
#

@stark geyser The UnityEvent... everywhere in the code base... Buttons for example dont render their UnityEvent OnClick :C

#

I googled for similar issues... but havent found a solution yet...

stark geyser
#

try removing and adding a new one

silver spruce
#

Did that several times... the same result... The UnityEventDrawer throws null pointer exceptions when it tries to render those events

stark geyser
#

But in a new project it works perfectly well?

silver spruce
#

My UnityEventDrawer is located in : Assets/Editor/UnityEventDrawer.cs is that correctly ?

#

Yep @stark geyser new project works fine

stark geyser
#

It's unlikely that is the problem with editor scripts. Your project just probably somehow tries to use outdated libraries or references

silver spruce
#

No fucking way... how the hell did the unity event drawer end up there ?! I deleted it and boom... the events are getting drawn correctly... @stark geyser Im sorry for wasting your time, looks like that script somehow ended up in the wrong place :/

onyx harness
#

@civic lotus mean what exactly? I don't get it

pure coral
#

im sorry a quick question but why is a [SerializeField] private list not shown in editor?

#

while a public one is?

#

i am aware dictionaries per example are not serializable but lists as well? i didnt find a relevant doc about it anywhere

#

unity version 2019.3.5f1

severe python
#

Lists are specialized to be serializable

#

so it should show up, but I'm not sure why its not in this case

pure coral
#

weird hmm

#

i mean its not something someone can mess up easily so i was curious about it

#

i did try per example a serialized integer
but lists dont work

severe python
#

it might be a quirk I'm unaware of

onyx harness
#

Screenshot and code

#

Is there any compile error?

pure coral
#

no compile errors

#

since i am not using it yet in anything

#

its a simple new script

#

and i wanted to test some things

#

so i simply added a public list before i do anything

#

and i noticed so

#

i should note though if thats the issue and my current hypothesis is that im doing this under a namespace

#

aka namespace smth (for now)

#

So if thats the reason thats happening how do i avoid this so?

#

but i dont believe this would be the issue, or atleast dont know it could be so

#

also please @ me in future replys so i can notice a message was posted

waxen sandal
#

Should really show some code

#

We can't guess

pure coral
#

hmm

#

well in monobehaviour i didnt see any issues

#

could it be from networkBehaviour? // using mirror

#

i am afraid i cant really post any code, its not a personal project and my employer has strict restrictions about code resharing

#

do pardon, if this makes this an inability to receive help then, ill just brute force it

#

cant really make exceptions for this

#

although for some reason i tried this around

#

and i kept it as serialize field and restarted unity

#

and it did work for now

#

so possibly an issue with some outdated component in the project or something else dunno

#

well either way

muted pelican
#

Anyone know of any good gamepad/input controllers for in-game menus?
Trying out some more complex UI's that just a square grid, but the native gamepad functionality with buttons are just bad.
Otherwise I'll just make my own if there are no public ones around, just don't wish to spend time inventing the wheel again if I can avoid it.

visual stag
muted pelican
visual stag
#

It's flexible.

civic lotus
#

@onyx harness it change the Unity Editor color

onyx harness
#

What is changing the Editor's color? Fullscreen?

#

@civic lotus

keen pumice
#

calling EditorGUI.Foldout with a rect parameter that has a width of 20, but it's not clipping the label to 20 pixels.
So, I tried creating a custom style, like so:

fixWidth.fixedWidth = 20;```
and passing that to the EditorGUI.Foldout function.. and while this does clip the label, it does not draw the foldout icon.
which GUI.skin SHOULD I use to start with?  I couldn't find a GUI.Skin.Foldout option.  Or should I be doing this a different way?
keen pumice
#

update: I found the EditorStyles.foldout GUIStyle. But, unexpectedly, setting the fixedWidth=20 seems to have no effect on the foldout's label.

wanton kindle
#

Anyone know a way of getting all the VisualElements under the mouse?

#

without, you know, querying and testing all of them

wanton kindle
#

tysm

severe python
#

you're very welcome sir, good luck and Thank you for using UI Toolkit!

onyx harness
#

Okay, I'm starting to learn UI Toolkit for real 😄

#

Wish me good luck

severe python
#

Good Luck, and if you need any help, feel free to ask

#

(and remebmer me in the future when you make a sweet asset :D)

onyx harness
severe python
#

into the blue spot?

onyx harness
#

Yep, done already, there is a EditorGUI.DrawRect drawing blue as a test

severe python
#

Is that area all UIElements now?

onyx harness
#

Nope, I see a IMGUIContainer

scenic elbow
#

i think entire editor is UIElements (with mostly IMGUIContainers) everywhere now

#

even the scene view is

#

pretty cool that you can just add an uielement onto the sceneview to use as overlay

onyx harness
#

Sounds promising indeed

waxen sandal
#

IIRC every window is wrapped in a UIToolkit/elements container

#

So it should be easy to just add an extra element that draw on top of everything

severe python
#

you can drop ui elements over the scene view?

scenic elbow
#

sceneview has a visualelement as root yea

#

so if you get a reference to SceneView for example by SceneView.beforeSceneGui callback (or some other way i guess)

#

you can do sceneView.rootVisualElement and add your own visual elements to that

#

and it'll appear on top

severe python
#

Waaaat that's awesome

onyx harness
#

You can pretty much inject anywhere

severe python
#

Here I am offering help

onyx harness
#

Does someone know how to access the current drawing EditorWindow?

severe python
#

From a ui elements context?

onyx harness
#

From a VisualElement yes

severe python
#

As far as I've found you have to pass that data in

#

Visual element does have a user data field

#

Sorry on my phone its. Autospacing everything and I've given up

#

If you're familiar with wpf, user data functions similarly to datacontext

#

There is a FindAncestorUserData method, which will search up the visual tree for a populated userData field and return it

#

I've used that previously to provide the editor context to my uielements, though I moved away from that

onyx harness
#

Seems... a lot of issues in the long run X)

severe python
#

Hence why I moved away from it

#

It tightly couples your visual element to editorwindow or some specific derivative

#

I still use UserData, but I dont look for anything specific, and I get properties and fields off that UserData based upon fields in my element

#

I realized I dont need to know the type if I'm expecting the developer to know what they are putting in and trying to bind to

#

What are you trying to accomplish exactly

onyx harness
#

If you don't access the EditorWindow, how do you force a Repaint from a VE?

severe python
#

Why do you want to repaint?

onyx harness
#

Because I updated the data from an external source. And would like the window to be up to date

severe python
#

So that suggests to me, and correct me if I'm wrong, that you're populating visual data manually in code, rather than using the binding system available

#

and that could be due to the fact that you're not necessarily connecting to something that is a UnityEngine.Object and therefor not representable by a SerializedObject?

onyx harness
#

I'm not even using UI Toolkit for real, I'm still injecting IMGUIContainer

severe python
#

oh

onyx harness
#

Which excludes binding yet

severe python
#

so you're doing most of your drawing in the IMGUIContainer, and you need that to repaint?

#

I can't say I know anything about IMGUIContainer tbh, I moved to UIElements specifically to get away from imgui

onyx harness
#

Yes

#

XD

severe python
#

I would have thought that IMGUIContainer would run gui code like normal

onyx harness
#

It would be, in a normal context

severe python
#

hmm

#

My best guess is that, there is probably an event somewhere you can hook to to invoke an update to the imguicontainer?

#

like EditorApplication.update

#

I'd bet theres a paint event

onyx harness
#

When I inject my IMGUIContainer in the spot I showed above. I don't inject in an EditorWindow.
It is in a Toolbar.

#

Toolbar derives from GUIView.
EditorWindow are contained in a HostView which derives from a GUIView

#

Therefore, when I extract the Toolbar, I have unfortunately no EditorWindow

severe python
#

Then why are you looking for an EditorWindow?

onyx harness
#

I was hoping there would be something in there, until I realized there is none

#

So now, I will just extract the GUIView and repaint it and hope it works

severe python
#

I can tell you that UIElements don't update in the same fashion as imgui, only things that change get redrawn

#

you make me want to work on VisualTemplates**, but I'm not sure what there is to actually work on except documentation

onyx harness
#

Hum...

#

I made it work, but clearly your concerns must be addressed for the long run, interesting, thanks for the intel !

severe python
#

is it possible to make an assetbundle at runtime?

waxen sandal
#

Not that I know of

silver spruce
#

Getting this error while i try to download a package from the manager.... no firewall is up and no proxy is used

#

Any idea why this happens ?

#

I also wanna mention that i only see the old versions of this package, newer versions dont show up, even if they are already released

keen pumice
#

sorry to ask the same question as yesterday guys- I'm just stumped by this- not making any sense to me: I have the following test code in a CustomProperty drawer's OnGUI GUIContent newLabel = new GUIContent("FoldoutTestNormalWidth", "testc"); EditorGUI.Foldout(position, false, newLabel, true); position.y += 20; newLabel = new GUIContent("FoldoutTest20Width", "testc"); position.width = 20; GUIStyle fixWidthFoldout = EditorStyles.foldout; fixWidthFoldout.fixedWidth = 20; EditorGUI.Foldout(position, false, newLabel, true, fixWidthFoldout); newLabel = new GUIContent("LabelTest20Width", "testc"); position.y += 20; EditorGUI.LabelField(position, newLabel); but this ONLY limits the width of the last field (the label), but NOT the width of the second foldout... Any ideas on what I'm doing wrong?

lean swift
#

no idea man, not too familliar with this stuff. Have you tried using more than one newLabel reference? maybe reusing the same one has adverse effects

keen pumice
#

will test now.. alas, same result. Thanks for taking a look tho!

lean swift
#

rect position still has width 20 when you place the last label
did you try EditorGUILayout.Foldout ?

keen pumice
#

This is for a property drawer, so, EditorGUILayout wont work in there 😦

lean swift
#

ah ok

keen pumice
#

that said... I AM able to limit the width of those by passing in a EditorGUILayoutOption:
GUILayout.FixedWidth(20). but the EditorGUI functions dont take such a parameter (only the layout version do).

keen pumice
#

if anyone cares- found this workaround: bool newArrayExpanded = EditorGUI.Foldout(foldoutRect, arrayExpanded, GUIContent.none, true); newArrayExpanded |= GUI.Button(foldoutRect, originalLabel, EditorStyles.label);

silver spruce
keen pumice
#

@silver spruce if close & repoen of unity and visual studio doesn't help.. I'd try deleteing the Library folder and let it reimport everything from scratch

silver spruce
#

@keen pumice Thanks that helped ! Do you know where i get "SampleGroupDefinition" from ? Its a error i have 81 times from the performance package due to the "Entities" depdencys

keen pumice
silver spruce
#

@keen pumice Well i have that packet installed... but its still missing, thats the weird part :/

keen pumice
#

is the error that it is not defined? if so.. have you added that namespace as a "using" at the top of the files where you reference SampleGroupDefinition?

silver spruce
#

@keen pumice The file is simply not there... i checked the package multiple times in my editor... that file is missing :/

keen pumice
#

what file?

silver spruce
#

"SampleGroupDefinition"

#

Oh wait... its a struct, not a file

#

isnt it ?

keen pumice
#

that structis probabaly defined in some DLL along with a bunch of other stuff. I wouldn't expect you to have a .cs file with that name.

silver spruce
#

Thats makes that problem even worse... the "Entities" package simply tells me it isnt there... "MethodMeasurement" is also missing... i upgraded/downgraded that performance testing api multiple times but the error stayed

keen pumice
#

exact error text, pls

silver spruce
#

Packages\com.unity.entities@0.8.0-preview.8\Unity.Entities.PerformanceTests\JobForEachPrefilteringPerformanceTests.cs(146,18): error CS1061: 'MethodMeasurement' does not contain a definition for 'Definition' and no accessible extension method 'Definition' accepting a first argument of type 'MethodMeasurement' could be found (are you missing a using directive or an assembly reference?)

#

Using performance testing api 2.0.9

keen pumice
silver spruce
#

@keen pumice Thanks for checking that out... but im not doing anything... this happened while installing the "entities" package... and i have no damn clue how to deal with that issue :/

keen pumice
#

ah, I see now. I'm no expert on packages, sorry bud. Is Unity.​Performance​Testing a seperate package?

silver spruce
#

@keen pumice It is required by the "Entities" package, but a seperate package on its own ^^

keen pumice
#

so, sounds like you DO have it installed.. hmm. Not sure what to suggest next, hopefully someone else wil.

silver spruce
#

@keen pumice Thanks for your helped ! Downgraded it to 1.3.3 and that did the trick... those dependencies are a real struggle :c

keen pumice
#

oh gosh, sounds like it. glad ya got it goin!

lucid hedge
#

Is is possible to add buttons to this toolbar?

#

the scene view toolbar

onyx harness
#

if anyone cares- found this workaround: bool newArrayExpanded = EditorGUI.Foldout(foldoutRect, arrayExpanded, GUIContent.none, true); newArrayExpanded |= GUI.Button(foldoutRect, originalLabel, EditorStyles.label);
@keen pumice don't use a button with a label style, but just a normal label

#

Why make things complex...

keen pumice
#

so I can click it to expand

onyx harness
#

Also, the foldout uses 2 styles as far as I remember

keen pumice
#

the EditorGUI.Foldout() function will only let me pass a single Style in, so I'm not quite sure what you mean, can you explain, please? @onyx harness

onyx harness
#

What you did was the right way

#

the scene view toolbar
@lucid hedge I'm not behind a computer, I can't check that in their code for now, later I will

#

@keen pumice you are drawing 2 ways of interactions, foldout & button. Just use one, you don't need 2

keen pumice
#

(the EditorGUI.Foldout()'s label does not respect the width of the Rect passed in.)

onyx harness
#

I know, but Foldout is already catching the click event, no?

keen pumice
#

yes.

#

ah.. I see.. the foldout click IS detected even when I draw a EditorGUI.Label over it. GUI.Button eliminated- thanks.

#

and interestingly.. the clickable area IS limited to the rect provided.

#

but still need to draw the label seperately with EditorGUI.Label, so it clips text that is too wide.

onyx harness
#

Yep, I told you, your trick is the right way

keen pumice
#

oh, that was for me, lol! ok, thanks @onyx harness ❤️

lucid hedge
#

alright thanks mikilo but for me it's fine

#

I put a button in scene view and works fine for what I want to do

forest hare
#

Does somebody know how Unity implements SerializedObject.ApplyModifiedProperties? This is an internal call to the native code of the engine, but i was wondering how they apply values from SerializedProperty... Maybe they store class member pointers in each SerializedProperty ?

onyx harness
#

Maybe

junior sphinx
#

Hi, I'm just starting since few week in the Attributes/Drawer developpement, I made some usefull Attributes, but I can't use them together
examples :
this works
[ ContainComponent(typeof(TabButton))]
public GameObject tabPrefab;
this works
[IsPrefab]
public GameObject tabPrefab;

but this not
[IsPrefab, ContainComponent(typeof(TabButton))]
public GameObject tabPrefab;

the second drawer/attribute is never call.

Multiple drawers are allowed by Unity or am I doing something wrong ?

waxen sandal
#

Yeah multiple ones aren't allowed :/

#

You can work around it with some reflection and stuff

junior sphinx
#

no 😢 so sad

#

Thank you Navi !

deft quail
#

Created a custom BuildScript. It worked a few times. Now it crashes to Desktop. Where to start?

public static void BuildGame(BuildTarget target, BuildOptions buildOptions, bool RunApp)
    {
        BuildPlayerOptions options = new BuildPlayerOptions();

        string Path = EditorUtility.SaveFolderPanel("Choose Location for Built Game", "", "");
        List<string> Levels = new List<string>();

        //CollectAllFilePathsInStreamingAssets.CollectFilePath();

        // Get Levels
            DirectoryInfo info = new DirectoryInfo("Assets/Scenes");
            FileInfo[] fileInfo = info.GetFiles();
            foreach (FileInfo file in fileInfo)
            {
                string Name = file.Name;
                if (!Name.Contains(".meta") && Name.Contains(".unity"))
                {
                    Levels.Add("Assets/Scenes/" + Name);
                }
            }

        // Set BuildOptions
            options.options = buildOptions;
            options.target = target;
            options.scenes = Levels.ToArray();
            options.locationPathName = Path;

        BuildPipeline.BuildPlayer(options);
}

commenting out the last line does not result to a CTD-

waxen sandal
#

Any errors in your editor log?

deft quail
#

where can i find it? @waxen sandal

waxen sandal
deft quail
#

never used that log

#

`` (Filename: Assets/Scripts/Editor/PreBuild/BuildProcess.cs Line: 52)

Exception: Invalid Build Path: D:/Programming``

#

is the Name of the App missing? @waxen sandal

waxen sandal
#

The target path is missing

#

You're probably passing a path somewhere right?

deft quail
#

Via Window

waxen sandal
#

Well not necessarily missing just incorrect

deft quail
#

D:/Programming is the path

waxen sandal
#

Try D:/Programming/build/ or something

deft quail
#

        string Path = EditorUtility.SaveFolderPanel("Choose Location for Built Game", "", "");```
#

Adding /name.apk does work

#

@waxen sandal thx

#

do you know how to check for Android device and run directly on it like build n run does?

waxen sandal
#

No clue

deft quail
#

damm

severe python
#

Are there any better information sources on SettingsProviders than the scripting reference

#

the scripting reference just mashes everything together and shows a variety of things and doesn't really indicate what you need and what is interchangeable

#

and its messy as a result of this

severe python
#

Does anyone happen to know if the UxmlTraits and UxmlFactory need to be a nested class within their defining types?

#

screams into the void

#

Anyone happen to know off hand if you can do inspectors with UIElements in 2018?

#

I'm trying to get VisualTemplates setup to function in every UIElements supporting version of unity to date

onyx harness
#

@severe python I found 3 ways to repaint the drawing container.
1/ Dirty(ChangeType.Repaint); // Which is Obsolete, prefer 2.
2/ MarkDirtyRepaint();
3/ Get the current GUIView and repaint it.

severe python
#

When do you call that

onyx harness
#

Still from IMGUIContainer code

#

In normal time, I would be able to call EditorWindow.focusedWindow.Repaint()

#

But in my case, I am not under an EditorWindow, but a Toolbar, which derives directly from GUIView.

solemn pagoda
#

making a custom package extension. Anyone know if there is something like Application.dataPath for packages?

onyx harness
#

Not that I know

waxen sandal
#

What exactly are you trying to do?

solemn pagoda
#

nevermind looks like the start of the path is just "Packages/...."

#

was overthinking it

#

I am saving data to json and need the path of my custom package folder. I think I got it now though

waxen sandal
#

Just to let you know

#

Path.GetFullPath gets you the path to an asset in a package

#

Whether it's in packagecache in your library dir or in the packages dir

#

Or in the Unity install dir

#

It's busted

#

They literally patched the runtime to fix that

solemn pagoda
#

awesome thanks I will try this out

severe python
#

is it possible to step through unity reference source by attaching to unity?

visual stag
#

Rider can do it alright

#

but I can't speak to anything else

#

well, It steps through the decompiled stuff

waxen sandal
#

I don't think using the reference source works

dapper fox
#

Hello, I was wondering: how do I make a custom window that holds a list in the same way as the Layer edit window? In particular: how is this kind of inspector list named in Unity?

severe python
#

oh so in theory the lastest VS can do it since it can decompile

#

but I have NFI how to turn that on

waxen sandal
#

@dapper fox reordable list?

dapper fox
#

@dapper fox reordable list?
@waxen sandal mmmh, that might be it, brb

severe python
#

I really need a better idea of how the actual Binding system works its really confusing

#

I can see bind events, but I can't see how they actually are used to update fields in the Unity code base

waxen sandal
#

IIRC the elements implement an interface

severe python
#

yeah, IBindable but its waaaaaaaaay more involved than that

#

there is also INotifyValueChanged which only works in simple scenarios

waxen sandal
#

Isn't most things INotifyValueChanged?

#

I looked into a it a while ago but mostly forgot 😅

severe python
#

its just BaseField really

#

I gotta approach this whole concept differenly because I'm obviously doing something wrong

#

but like, how would you implement INotifyValueChanged for a field that can host any type of object and determines its content based upont he data type

#

(DataTemplates)

waxen sandal
#

You don't because Unity does not support complex bindings

severe python
#

I kinda sorta really hate flexbox

#

I can't make proper grids

#

property grids literally require you to set the width somewhere in order to have alignment

#

its this big glaring flaw

#

this all looks nice

#

so you can either flex on the width, or on the height of the elements, but you can't do both

#

but my binding stuff is doing something I don't understand

#

the PPtr<$CampaignSegment> is the data type I found on the boundObject passed through the Binding event

#

I expect to find a CampaignSegment, but this is an object reference, I just want the actual target object...

severe python
#

it seems like Inspectors do something that I'm not seeing

#

my data templating and binding works perfectly under the context of inspector

#

but if I try to make a window, it doesn't

#

in the inspector, the bindings naturally establish context for nested elements

opaque harness
#

I have no idea why my custom inspector isn't showing

#

Does anything seem off about this?

[CustomEditor(typeof(Traveler))]
public class TravelerEditor : UnityEditor.Editor
{
    public override void OnInspectorGUI()
    {
        // DrawDefaultInspector();
        var traveler = (Traveler) target;
        GUILayout.Label("Foo");
    }
}
#

Everything I see seems to match every single guide/tutorial/documentation I can find and it's just not changing the Inspector in my editor at all

onyx harness
#

Show Traveler

opaque harness
#

I got it now, not sure what it was but it started working after some other messing around

fiery canopy
#

Is there a way to get an animation preview to run inside a editor window?

waxen sandal
solemn hedge
#

Hello guys i have an idea to make a wizard tactical "shooter", and i want to make you can cast spell just swinging your wand in the correct shape, and i know about you can do it with line renderers but how?

keen pumice
timid whale
#

Is there really no way to override the inspector Header for a custom editor? What the actual heck...

onyx harness
#

Nope

#

What exactly are you trying to do?

#

There is some part where you can infiltrate

timid whale
#

I'm trying to add multiple components of the same type. Said type uses a unique ScriptableObject for some stuff so I wanted the header name to be the name of the ScriptableObject

#

I've also noticed that the object picker detects via gameobject and not via component, so trying to choose between multiple components using the picker is impossible. What is the use of multiple components of the same type then? Wouldn't it be the same if I had a list inside a MonoBehaviour and use a serialized custom class since components don't seem to offer additional functionality...

onyx harness
#

Clearly Unity does not handle multiple similar Components when picking/drag&dropping

#

You can still add many (as an example) AudioSource on one single GameObject

timid whale
#

I know, I just found it really weird that they are limiting things like that. I'm literally forced to create empty GameObjects to attach my component there so I can have a different name and pick / drag & drop utility. That means that I get extra matrix multiplications for no reason. Ugh... something as simple as that shouldn't be so hard.

onyx harness
#

Well

#

I can suggest you NG Tools Free

#

There is a little utility in there to handle multi Component in an Object field

#

It allows you to drag & drop from Object field to Object field. And also pick a specific Component by right-clicking

timid whale
#

Oh.. thanks a lot! I'll be checking that!

onyx harness
#

Field C is of Object type

slender comet
#

<@&502880774467354641> Who can I contact to find out more information for Unity ProBuilder in PreviewRenderUtility. I am working on an EditorWindow for a ScriptableObject and would like to be able to use the Edge selection functionality. TIA

visual stag
#

@slender comet Please do not ping admins for support issues

#

This is not an official support channel

#

Ask on the forums

#

You also have complete access to the source of probuilder and can find that sort of thing if you look

slender comet
#

My apologies. I will see about the forum. I have reviewed the code for both gits. Thank you.

visual stag
#

Both gits? The code is local (referenced into your project) when you have imported probuilder with the Package Manager, you can just look in the Packages/Probuilder directory in your Project View (IDEs should also be able to explore it) @slender comet

slender comet
#

Thank you

azure prawn
#

Anyone worked with the Unity Recorder yet? If so did you have pretty bad framerate?

#

I mean of Unity not the recording.

visual stag
#

it is designed for offline recording, so yes

#

You might be able to get it to not be that bad if you were recording mp4 with some alright settings chosen

weak bone
#

Where e is the current event

#

It must return true when I hold leftshift and click the mouse button

sudden parcel
#

Hello, I want to call a function each time I open a custom asset type (like asset.myasset), custom importer already done, I found that I can use the OnOpenAssetAttribute, but I don't know how to verify if the asset that is selected is of type myasset, can anyone help me, please

onyx harness
#

It must return true when I hold leftshift and click the mouse button
@weak bone it can't

#

hum... sorry, misread

#

Just print a log, you'll have your answer rightaway

weak bone
#

I did... The first if condition only isn't working..
if(e.keyCode==KeyCode.LeftShift)
Debug.Log("press");

#

If I do
Debug.Log(e.keyCode);

It's printing None even if I press some key

onyx harness
#

Modifiers are not always sent

#

they might be cached or not even sent

weak bone
#

I didn't understand 😅

onyx harness
#

It is possible that a left shift event is not triggering anything

weak bone
#

If I do
e.shift
It detects..
Don't know why it isn't working for keyCodes

onyx harness
#

That's what I just said, sometime a "Modifier" (shift, alt, ctrl, fn, cmd, windows) are not being triggered

weak bone
#

Okay, ... Even alphabets arent being detected

onyx harness
#

you must have done a mistake somewhere

weak bone
#

Hmmm
I just did
Event e=Event.current;
Debug.Log(e.keyCode);

#

e.character is also not working

#

Oh, I had to put my cursor in the scene and press keys as I had added that function into SceneView.OnSceneGUIDelegate 😅

#

I wanna spawn object at mousePosition with 0 as z value
I did
SpawnedObj.position=Camera.current.ScreenToWorldPoint(new Vector3(e.mousePosition.x,e.mousePosition.y,0));

It's spawning elsewhere.. All the spawned object spawn at the same point

next canopy
#

Anyone have experience with editor scene staging?

safe patio
#

hey guys does anyone know why DOTween causes pause error when animating in the unity ediutor but is fine on windows and android builds?

#

ahh think ive got it

onyx harness
#

Anyone have experience with editor scene staging?
@next canopy?

next canopy
#

You know when you edit a prefab it makes a "new scene" sort of thing?

#

Thats the prefab scene stage, its a fairly new thing, and it's not well documented, and a lot of the stuff that's useful to me is marked internal in the unity cs reference

onyx harness
#

Yeah yeah I know the stage

#

Go to the point

next canopy
#

How do I make one and open it?

#

How do I write my own custom scene stage for editing an asset?

onyx harness
#

By opening a Prefab, you might trigger a Prefab Stage opening (not tested)

#

But, what do you mean by writing your own custom stage? This is not something you customize

next canopy
#

Why isn't it?

#
Description
The PreviewSceneStage class represents an editing context based on a single preview Scene.

You can create a custom type of Stage by implementing a class that inherits from the abstract PreviewSceneStage class. Your custom Stage should ensure any content it controls is moved into the preview Scene that the stage controls.```
#

From the manual

onyx harness
#

Oh sweet

#

Never touched this class before, can't help you unfortunately

next canopy
#

My search continues

#

As well as my journey to spread awareness about this super useful utility

tender orbit
#

I got this error 3 month ago, and today again

#

Someone have a solution ?

marble dove
#

Hey weird question is there a good way to get the array of selected gameobjects/transforms in Edit Mode to a Monobehavior executing in Editor?

severe python
#

Chexk out the Selection class

next canopy
#

.gameObjects is what you want for GameObjects

#

And i think you can do Object[] transforms = Selection.GetFiltered(typeof(Transform), SelectionMode.TopLevel) to get the transforms of every object you've selected

#

You might be able to omit the second parameter

chrome star
waxen sandal
#

This channel is for extending the editor

#

And no dynamically named variables are not supported

#

You can use a dictionary though

deft quail
#

@chrome star just use dicts with a string as key

steady crest
#

why would you use wizards instead of editorwindows? I dont seem to find any difference

#

they both seem capable of the same thing.

onyx harness
#

Wizard has just an automatic behaviour

steady crest
#

which means editor windows are better if you want full control? @onyx harness

onyx harness
#

Indeed

trim charm
#

Anyone knows the name of that animation window that has an avatar in it?

#

I am trying to add the same window in my window lol

steady crest
#

hmm if I create an object, I can add it to a list. but if I delete that object, how do I remove it from that list?

trim charm
short tiger
#

@steady crest So when you say object, you mean something inheriting UnityEngine.Object which you are destroying with Object.Destroy?

#

Like a Game Object or something

steady crest
#

something I am destroying by deleting the SO in my project window

#

its basically an itemdatabase, I want that when I add an item it add it to the list, but when its ddeleted it doesnt leave a residual file in the database

short tiger
#

ScriptableObject has a OnDestroy event method, like MonoBehaviour

steady crest
#

does that get called in the editor?

trim charm
#

@onyx harness Any thoughts on my question?

steady crest
#

yes, but doesnt ondestroy only get called on objects in the scene> I am working with assets in my database

onyx harness
#

You would like to simulate a preview window in your EditorWindow?

#

Nobody stated that OnDestroy is only for scene

trim charm
#

Yes, exactly that window in the pic I sent (not sure what it is called)

steady crest
#
public class RemoveItemIfDeleted : UnityEditor.AssetModificationProcessor
{
    public static AssetDeleteResult OnWillDeleteAsset(string assetPath, RemoveAssetOptions roa)
    {
        var item = AssetDatabase.LoadAssetAtPath<ItemData>(assetPath);
        if (item != null)
        {
            var window = EditorWindow.GetWindow<EditorManager>();
            window.ItemDatabase.Remove(item);
        }

        return AssetDeleteResult.DidNotDelete;
    }
}
#

I did just find this

onyx harness
#

This works if you don't have control over the C# script of the SO

#

Prefer OnDestroy instead of polluting your pre/post process

steady crest
#

makes sense, thx

onyx harness
#

@trim charm Preview is not an easy task

#

The one in the Inspector is tightly coupled to the Inspector itself

trim charm
#

The animation one right?

onyx harness
#

The one in the picture above

trim charm
#

So no way to do it?

onyx harness
#

You can find it in UnityEditor.PreviewWindow.OnGUI()

trim charm
#

That is worse than Corona

#

Are you sure this is the same one in the pic?

onyx harness
#

there is a big big chance, yes

#

I studied a lot the Inspector

trim charm
#

So just copy and paste lol 🤔

onyx harness
#

Nope

#

Most classes are internals

#

You must use Reflection

#

If you are not fluent with it, I can give you a little utility to generate wrappers

trim charm
#

Yes plz

onyx harness
#

But afterall, you must understand how stuff works

#

Like Editor

#

Do you even play with Editor in your EditorWindow?

trim charm
#

What do you mean play?

onyx harness
#

Sorry

#

Use

trim charm
#

Yea

onyx harness
#

This is how you create previewables

trim charm
#

Why a list?

onyx harness
#

Based on the Editors present in the Inspector

trim charm
#

It is one editor window

onyx harness
#

With Previewables you can DrawPreview() on them

#

Editor != EditorWindow

trim charm
#

Yea I am not talking about Editor

onyx harness
#

But you need one

trim charm
#

More like an object field inside my window that displays the object in the previewable

onyx harness
#

You can create an Editor from the Object of this field

#

By checking HasPreviewGUI() from the Editor, you can know if yes or no you can preview it

#

if yes, DrawPreview(), job done I would say

trim charm
#

Ok but won’t that show the previewable in the object’s inspector?

onyx harness
#

DrawPreview(area) requests a Rect as argument

#

So, at this point, it's up to you

trim charm
#

So where to start lol?

onyx harness
#

E = new Editor(Object)
if (E.HasPreviewGUI() == true)
E.DrawPreview()

#

You don't even need internal stuff

#

Wonderful

#

lol

trim charm
onyx harness
#

i'm stupid, IPreviewable is internal...

trim charm
#

I need them animations to play as well

#

God dammit

onyx harness
#

So...

#

Based on your knowledge, you already know it is not going to work

#

How do you know?

trim charm
#

Damn is that an insult xD?

onyx harness
#

I feel this is the opposite

#

I just spent some time with you to guide you toward your objective, dropped screenshot, code, advices

#

and at the end you tell me without even trying "that won't make this"

trim charm
#

Yea sorry about that

#

Should try first

onyx harness
#

If you haven't tried, you can state anything

steady crest
#

@onyx harness if I do the OnDestroy method you suggest that methods getting called every time I look at the inspector of the SO and close it. thus removing it from the database if you deselect that object

trim charm
#

True

onyx harness
#

@steady crest Why would it be destroyed when deselecting the Object?

#

@trim charm You might be surprised

#

@steady crest When do you create it?

steady crest
#

cuz I need to call it OnDestroy in the editorscript of the item to access the editorwindow that holds the database