- Home /
Using SerializedObject in a build
Hi, I have a problem. I need to access a property of the shiruken particle system (ShapeModule.boxX) which is not exposed. For this I use SerializedObject and then I access this property with: FindProperty("ShapeModule.boxX").floatValue. To use these methods and classes I need to include UnityEditor as a namespace. The problem is that I need to be able to modify the property at run-time, but when I try to build the project, an error occurs because I can't use UnityEditor namespace outside unity. How can I get around this. I really need this functionality. Thanks.
I know this question is quite old but did you find a solution for this? I'm facing the same problem right now :(.
Answer by Clet_ · May 05, 2014 at 04:15 AM
I had to do the relative same with mecanim. I needed to access the internal graph of the state machine, which was only exposed in the UnityEditorInternal namespace.
I made my own serializer for animators, made an animator wrapper, and then worked with that wrapper. The main goal is to serialize all the fields you need at runtime inside a .txt file (I used a JSON parser) and then, read this .txt, deserialize it and build the wrapper class accordingly.
You then need to expose, inside the wrapper class, everything you would potentially need at runtime.
This is not a very specific answer, but I hope it will guide you through implementing some sort of similar system.
Hi Clet_ Thanks for your answer. That seems much more complex than what I was hoping for... I'll see what I can do.
Your answer
Follow this Question
Related Questions
CommandInvokationFailure: Gradle build failed 2020 0 Answers
Unity crashing my Macbook Air during android builds 0 Answers
Realtime GI does not work when project is build in unity 2018.4.18 1 Answer
Unity started rejecting my scripts? 1 Answer
Project scripts stop working after building it in Android 1 Answer