Пример #1
0
    private List <NGUIWidgetInfo> GetWidgetInfoListByShowType(NGUIPrefabInfo info, ShowType type)
    {
        var list = new List <NGUIWidgetInfo>();

        switch (type)
        {
        case ShowType.Empty:
        {
            break;
        }

        case ShowType.All:
        {
            list.AddRange(info.WidgetList);
            break;
        }

        case ShowType.EmptySprite:
        {
            list.AddRange(info.GetUISpriteEmptyList());
            break;
        }

        case ShowType.EmptyLabel:
        {
            list.AddRange(info.GetUILabelEmptyList());
            break;
        }

        case ShowType.WrongLabelDepth:
        {
            list.AddRange(info.GetUILabelNotSatisfiedDepthList(CommonLabelDepth));
            break;
        }

        case ShowType.SameDepthCombineDrawCallFail:
        {
            list.AddRange(info.GetSameDepthCannotCombineDrawCall());
            break;
        }
        }

        return(list);
    }
Пример #2
0
    private void RightTopPanel()
    {
        EnumPopup <ShowType>("当前显示(不可修改)", _showType);

        Space();
        Button("刷新", () => RefreshConfig());

        Space();
        Button("显示全部", () => SwitchShowType(ShowType.All));

        Space();
        Button("空Sprite", () => SwitchShowType(ShowType.EmptySprite));

        Space();
        Button("空Label", () => SwitchShowType(ShowType.EmptyLabel));

        Space();
        Button(string.Format("错误Label Depth({0})", CommonLabelDepth), () => SwitchShowType(ShowType.WrongLabelDepth));

        Space();
        Button("同Depth不能合并DrawCall", () => SwitchShowType(ShowType.SameDepthCombineDrawCallFail));

        FlexibleSpace();

        Space();
        _objectAdded = ObjectField("场景物体:", _objectAdded, typeof(GameObject), true);
        if (_objectAdded != null)
        {
            var prefabType = PrefabUtility.GetPrefabType(_objectAdded);
            if (prefabType != PrefabType.Prefab && prefabType != PrefabType.PrefabInstance)
            {
                ShowNotification(new GUIContent(prefabType.ToString()));
                _objectAdded = null;
            }
        }
        if (_objectAdded != null && (_selectPrefabInfo == null || _selectPrefabInfo.Prefab != _objectAdded))
        {
            _selectPrefabInfo = new NGUIPrefabInfo(_objectAdded as GameObject);
        }
    }
Пример #3
0
 private void OptimizeWidgetsDepth(NGUIPrefabInfo info)
 {
     info.OptimizeWidgetsDepth(CommonLabelDepth);
 }
Пример #4
0
 private void CompressWidgetDepth(NGUIPrefabInfo info)
 {
     info.CompressWidgetDepth(CommonLabelDepth);
 }
Пример #5
0
 private void FixedLabelDepth(NGUIPrefabInfo info)
 {
     info.FixedLabelDepth(CommonLabelDepth);
 }
Пример #6
0
 private void ClearSelected()
 {
     _objectAdded      = null;
     _selectPrefabInfo = null;
 }