How to draw shared variables with a button to choose in my custom task editor?

YnS

New member
I tried to use a simple ObjectDrawer for my custom task and everything worked fine other than shared variables. But I do not know how to draw a shared variable just like without using the custom editor(with a button to choose a shared variable)

Here is my code and the error I got.

C#:
customClass.iceFlameList.Value = (SharedVariable<List<GameObject>>)EditorGUILayout.ObjectField(customClass.iceFlameList.GetValue(), typeof(SharedVariable<List<GameObject>>));
Return Error "Can not convert object to UnityEngine.Object"

1111.png


I tried to use a for loop to draw every component in the shared variable list, but the button to choose a shared variable just missed.
 
Shared variables can be drawn using BehaviorDesigner.Editor.FieldInspector.DrawSharedVariable.
 
  • Like
Reactions: YnS
Top