FairyGUI.UIPackage.GetItems C# (CSharp) Method

GetItems() public method

public GetItems ( ) : List
return List
        public List<PackageItem> GetItems()
        {
            return _items;
        }

Usage Example

Example #1
0
    private void OnGUI()
    {
        if (target == null || EditorApplication.isCompiling)
        {
            Close();
            DestroyImmediate(this);
            _instance = null;
        }

        if (fairGUIItems == null)
        {
            target.LoadAllAssets();
            fairGUIItems = target.GetItems();
            Debug.Log("$$ loaded assets count:" + fairGUIItems.Count);
            selectInfos = new bool[fairGUIItems.Count];
        }

        EditorGUILayout.BeginVertical();

        scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
        for (int i = 0, c = selectInfos.Length; i < c; i++)
        {
            var itemName = fairGUIItems[i].name;
            if (!string.IsNullOrEmpty(itemName))
            {
                //GUI.Button(Rect.MinMaxRect(0, 0, 600, 80), "");
                //EditorGUI.DropdownButton(Rect.MinMaxRect(0, 0, 600, 80), new GUIContent("", ""), FocusType.Passive);
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(itemName);
                selectInfos[i] = EditorGUILayout.Toggle(selectInfos[i]);

                EditorGUILayout.EndHorizontal();
            }
        }

        EditorGUILayout.EndScrollView();
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        if (GUILayout.Button("生成Ctrl"))
        {
            List <FairyGUI.PackageItem> itemsToGen = new List <FairyGUI.PackageItem>();
            for (int i = 0, c = selectInfos.Length; i < c; i++)
            {
                if (selectInfos[i])
                {
                    itemsToGen.Add(fairGUIItems[i]);
                }
            }

            CodeGenerator.GenerateCtrlPartGen(itemsToGen, target);
            CodeGenerator.GenerateCtrlPartMain(itemsToGen);
        }
        EditorGUILayout.EndVertical();
    }
All Usage Examples Of FairyGUI.UIPackage::GetItems