Exemplo n.º 1
0
        public override VisualElement CreatePropertyGUI(SerializedProperty property)
        {
            var field    = new ActionAssetField();
            var attr     = fieldInfo.GetCustomAttribute <ActionTypeAttribute>();
            var settings = ProjectUtility.GetProjectAsset <ActionGraphGlobalSettings>();

            if (attr != null && ActionDefinitionAsset.Load(attr.type, out var info))
            {
                field.ActionId = info.id;
            }
            field.Label = property.displayName;
            field.BindProperty(property);
            return(field);
        }
Exemplo n.º 2
0
        public static ActionAssetSelectorWindow ShowWindow(ActionAssetField field)
        {
            var window = ScriptableObject.CreateInstance <ActionAssetSelectorWindow>();

            window.titleContent   = new GUIContent("Select");
            window.minSize        = new Vector2(320, 480);
            window.ActionIdFilter = field.ActionId;
            window.Receiver       = field;
            window.ShowUtility();
            //window.ShowPopup();
            //window.position = new Rect(new Vector2(field.worldBound.position.x,field.worldBound.position.y + EditorGUIUtility.singleLineHeight), new Vector2(field.worldBound.width, 480));

            return(window);
        }