Пример #1
0
 public AssetBundleManageTab()
 {
     m_HorizontalSplitterPercent    = 0.4f;
     m_VerticalSplitterPercentRight = 0.7f;
     m_VerticalSplitterPercentLeft  = 0.85f;
     m_Operation = new AssetBundleOperation.AssetDatabaseABOperation();
 }
Пример #2
0
        private void DrawBundleTreeToolBarGUI(Rect r)
        {
            GUILayout.BeginArea(r);

            using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar)) {
                if (GUILayout.Button(new GUIContent(string.Format("{0} ({1})", m_Operation.Name, m_Operation.ProviderName), "Select Asset Bundle Set"),
                                     EditorStyles.toolbarPopup, GUILayout.Width(200f), GUILayout.Height(r.height)))
                {
                    GenericMenu menu      = new GenericMenu();
                    bool        firstItem = true;

                    foreach (var info in AssetBundleOperation.ABOperationProviderUtility.CustomABOperationProviderTypes)
                    {
                        var newProvider = info.CreateInstance();

                        if (!firstItem)
                        {
                            menu.AddSeparator("");
                        }

                        for (int i = 0; i < newProvider.GetABOperationCount(); ++i)
                        {
                            var op = newProvider.CreateOperation(i);

                            menu.AddItem(new GUIContent(string.Format("{0} ({1})", op.Name, op.ProviderName)), false,
                                         () => {
                                var thisOperation = op;
                                m_Operation       = thisOperation;
                                ForceReloadData();
                            }
                                         );
                        }

                        firstItem = false;
                    }

                    menu.DropDown(new Rect(4f, 8f, 0f, 0f));
                }

                GUILayout.FlexibleSpace();
                if (m_Operation.IsReadOnly())
                {
                    GUIStyle tbLabel = new GUIStyle(EditorStyles.toolbar);
                    tbLabel.alignment = TextAnchor.MiddleRight;

                    GUILayout.Label("Read Only", tbLabel, GUILayout.Width(60f), GUILayout.Height(r.height));
                }
            }

            GUILayout.EndArea();
        }