Ejemplo n.º 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);
    }
Ejemplo n.º 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);
        }
    }
Ejemplo n.º 3
0
 private void OptimizeWidgetsDepth(NGUIPrefabInfo info)
 {
     info.OptimizeWidgetsDepth(CommonLabelDepth);
 }
Ejemplo n.º 4
0
 private void CompressWidgetDepth(NGUIPrefabInfo info)
 {
     info.CompressWidgetDepth(CommonLabelDepth);
 }
Ejemplo n.º 5
0
 private void FixedLabelDepth(NGUIPrefabInfo info)
 {
     info.FixedLabelDepth(CommonLabelDepth);
 }
Ejemplo n.º 6
0
 private void ClearSelected()
 {
     _objectAdded      = null;
     _selectPrefabInfo = null;
 }