public void OnGUI()
        {
            showAssembly = EditorGUILayout.Foldout(showAssembly, new GUIContent(titleAssembly, descriptionAssembly));

            if (showAssembly)
            {
                GUILayout.BeginVertical(Styles.background, GUILayout.ExpandHeight(true));

                float height = LudiqGUI.GetInspectorHeight(null, assemblyOptionsMetadata, Styles.optionsWidth, GUIContent.none);

                EditorGUI.BeginChangeCheck();

                var position = GUILayoutUtility.GetRect(Styles.optionsWidth, height);

                LudiqGUI.Inspector(assemblyOptionsMetadata, position, GUIContent.none);

                if (EditorGUI.EndChangeCheck())
                {
                    assemblyOptionsMetadata.Save();
                    Codebase.UpdateSettings();
                }

                if (GUILayout.Button("Reset to Defaults", Styles.defaultsButton))
                {
                    assemblyOptionsMetadata.Reset(true);
                    assemblyOptionsMetadata.Save();
                }

                LudiqGUI.EndVertical();
            }

            if (GUILayout.Button(completeLabel, Styles.defaultsButton))
            {
                UnitBase.Rebuild();

                EditorUtility.DisplayDialog("Visual Script", "Regenerate Nodes completed", "OK");
            }
        }
        public override void Prewarm()
        {
            filter = filter ?? UnitOptionFilter.Any;

            try
            {
                options = new HashSet <IUnitOption>(UnitBase.Subset(filter, reference));
            }
            catch (Exception ex)
            {
                Debug.LogError($"Failed to fetch unit options for fuzzy finder (error log below).\nTry rebuilding the unit options from '{UnitOptionUtility.GenerateUnitDatabasePath}'.\n\n{ex}");
                options = new HashSet <IUnitOption>();
            }

            typesWithMembers = new HashSet <Type>();

            foreach (var option in options)
            {
                if (option is IMemberUnitOption memberUnitOption && memberUnitOption.targetType != null)
                {
                    typesWithMembers.Add(memberUnitOption.targetType);
                }
            }
        }
Example #3
0
 protected MemberUnitOption(TMemberUnit unit) : base(unit)
 {
     sourceScriptGuids = UnitBase.GetScriptGuids(unit.member.targetType).ToHashSet();
 }
Example #4
0
 public override void RunAction()
 {
     UnitBase.Build();
 }
 public LiteralOption(Literal unit) : base(unit)
 {
     sourceScriptGuids = UnitBase.GetScriptGuids(unit.type).ToHashSet();
 }
        protected override void Complete()
        {
            UnitBase.Build();

            base.Complete();
        }
 public ExposeOption(Expose unit) : base(unit)
 {
     sourceScriptGuids = UnitBase.GetScriptGuids(unit.type).ToHashSet();
 }