Hey Folks. I used the DrawDefaultInspectorWithoutScriptField by JAKJ and it gave me kind of the Idea of creating a custom Inspector, that could inject content where I want without writing everything from anew.
So now I wanted to add some functionality to the scriptableObject Fields, among them, creating a
new one.
Problem is, the most promising value I can get to figure out a serializedProperty’s Object’s type is serializedProperty.type, which is a string, giving me this: PPtr<$ScriptableObject>
So I deleted PPtr<$>
and used the remaining string to use type.getType(string) with another ScriptableObject’s reflected Assembly.
string str = serializedProperty.type.Replace("PPtr<$", "").Replace(">", "");
string other = "Namespace." + str + ", " + typeof(OtherScriptableObject).Assembly;
Type type = Type.GetType(other);
However, this is not safe for Scriptable Objects inside Namespaces (and I think classes), so my Question is, is there something more appropriate to get the Type of a serializedProperty’s Object or Do I have to politely ask the Dev Team for a more sophisticated indicator?^^
yes, otherwise the index array for which vertex goes into which triangle would be messed up.
– Fevre