- Home /
Multiple object Selection in project view: Unity shows wrong type
When I select multiple items from the project view, if one of them is a custom asset (class derived from ScriptableObject), the selection list looks like this:
Question:
What needs to be done so that the "Mono Behavior" listing, instead shows my custom (descendant-of-ScriptableObject) Class name?
What does Monobehavior have to do with scriptableObject anyway? That they both derive from Object, is the only link I see.
Alternatively, and more generally, I'd like to specify a string as a "type" name for each custom asset type I've made. Is there some virtual function I should override for to make this work right? ("Name" member of Object is close, but that's for each instance, not the class itself.)
I have tried creating an Editor and project Icon(by adding a file: gizmos\assetsclassname icon.png) for the asset type. Though the editor and icon both work properly in other ways, they do NOT effect the name of the asset type in the shown selection list. Is there an editor function to override that can do this?
Possibly relevant: I AM using EditorApplication.projectWindowItemOnGUI +=
to specify a function that draws a special icon for my custom assets. Update: Limited tests show this does not seem to be related.
Here is an example of a selected scriptableObject asset's class, if relevant.
public class SimpleLineList : ScriptableObject
{
public Vector3[] lineList;
[MenuItem("GameObject/Create SimpleLineList")]
static void CreatBlankLineList()
{
AssetDatabase.CreateAsset(SimpleLineList.CreateInstance<SimpleLineList>(), "Assets/newSimpleLineList.asset");
}
}
Your answer
Follow this Question
Related Questions
Getting assets / sub folders inside a folder 1 Answer
Import Unity package / Asset by script with selection 0 Answers
How to obtain selected files in the Project-window? 1 Answer
Getting all assets of the specified type 5 Answers
How to highlight or select an asset in project window from editor script? 2 Answers