private void DrawInstruction(Rect rect, GUIContent label) { var instruction = AssetDisplayDrawer.Draw(rect, label, _caller.Instruction, true, true, AssetLocation.Selectable, null); if (_caller.Instruction != instruction) { _caller.Instruction = instruction; Refresh(); } }
private static void DrawStoreConstraint(Rect rect, ref VariableConstraint constraint) { if (!(constraint is StoreVariableConstraint storeConstraint)) { storeConstraint = new StoreVariableConstraint { Schema = null }; constraint = storeConstraint; } storeConstraint.Schema = AssetDisplayDrawer.Draw(rect, GUIContent.none, storeConstraint.Schema, false, false, AssetLocation.None, null); }
private static VariableValue DrawObject(Rect rect, VariableValue value, ObjectVariableConstraint constraint) { var objectType = constraint?.Type ?? value.ReferenceType ?? typeof(Object); var unityObject = value.Object; if (typeof(Component).IsAssignableFrom(objectType) || typeof(GameObject) == objectType || typeof(Object) == objectType) { unityObject = EditorGUI.ObjectField(rect, GUIContent.none, value.Object, objectType, true); } else { unityObject = AssetDisplayDrawer.Draw(rect, GUIContent.none, unityObject, objectType, true, true, AssetLocation.None, null); } return(VariableValue.Create(unityObject)); }