public void Draw(Rect r) { int border = 10; float splitH = 0.4f; float splitW = 0.5f; int toolbarHeight = 80; float spacePixel = 10.0f; //GUILayout.BeginArea(r); GUILayout.BeginVertical(); m_control.Draw(); BundleImportData data = m_control.Data; GUILayout.BeginHorizontal(TableStyles.Toolbar); { EditorGUILayout.LabelField("LimitCount : "); data.LimitCount = EditorGUILayout.IntField(data.LimitCount); GUILayout.Space(spacePixel); EditorGUILayout.LabelField("LimitKBSize : "); data.LimitKBSize = EditorGUILayout.IntField(data.LimitKBSize); GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(TableStyles.Toolbar); { EditorGUILayout.LabelField("BundleType : "); data.Type = (BundleType)EditorGUILayout.EnumPopup(data.Type); GUILayout.Space(spacePixel); EditorGUILayout.LabelField("LoadState: "); data.LoadState = (BundleLoadState)EditorGUILayout.EnumPopup(data.LoadState); GUILayout.Space(spacePixel); data.Publish = GUILayout.Toggle(data.Publish, " Publish"); GUILayout.Space(spacePixel); data.PushDependice = GUILayout.Toggle(data.PushDependice, " Push"); GUILayout.Space(spacePixel); data.SkipData = GUILayout.Toggle(data.SkipData, " SkipData"); GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(TableStyles.Toolbar); { if (GUILayout.Button("Move Up Priority", TableStyles.ToolbarButton, GUILayout.MaxWidth(120))) { m_control.ModifDataPriority(true); } if (GUILayout.Button("Move Down Priority", TableStyles.ToolbarButton, GUILayout.MaxWidth(120))) { m_control.ModifDataPriority(false); } if (GUILayout.Button("Create Bundle", TableStyles.ToolbarButton, GUILayout.MaxWidth(140))) { m_control.RefreshBaseData(); BundleAdapter.CreateBundles(); } if (GUILayout.Button("Build All Bundle", TableStyles.ToolbarButton, GUILayout.MaxWidth(140))) { BundleAdapter.UpdateBundleBuildList(); BundleAdapter.BuildBundles(); } if (GUILayout.Button("Clear All Bundle", TableStyles.ToolbarButton, GUILayout.MaxHeight(140))) { BundleDataManager.RemoveAllBundle(); } GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); int startY = toolbarHeight + border; int height = (int)(r.height - startY - border * 2); if (m_dataTable != null) { m_dataTable.Draw(new Rect(border, startY, r.width - border, (int)(height * splitH - border * 1.5f))); } if (m_bundleTable != null) { m_bundleTable.Draw(new Rect(border, (int)(height * splitH + border * 0.5f + startY), (int)(r.width * splitW) - border * 1.5f, (int)(height * (1.0f - splitH) - border * 1.5f))); } if (m_assetTable != null) { m_assetTable.Draw(new Rect((int)(r.width * splitW) + border * 0.5f, (int)(height * splitH + border * 0.5f + startY), (int)(r.width * (1.0f - splitW)) - border * 1.5f, (int)(height * (1.0f - splitH) - border * 1.5f))); } GUILayout.EndVertical(); //GUILayout.EndArea(); }
public void Draw(Rect r) { int border = 10; float split = 0.8f; int toolbarHeight = 80; float spacePixel = 10.0f; //GUILayout.BeginArea(r); GUILayout.BeginVertical(); m_control.Draw(); BundleImportData data = m_control.Data; GUILayout.BeginHorizontal(TableStyles.Toolbar); { EditorGUILayout.LabelField("LimitCount : "); data.LimitCount = EditorGUILayout.IntField(data.LimitCount); GUILayout.Space(spacePixel); EditorGUILayout.LabelField("LimitKBSize : "); data.LimitKBSize = EditorGUILayout.IntField(data.LimitKBSize); GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(TableStyles.Toolbar); { EditorGUILayout.LabelField("BundleType : "); data.Type = (BundleType)EditorGUILayout.EnumPopup(data.Type); GUILayout.Space(spacePixel); EditorGUILayout.LabelField("LoadState: "); data.LoadState = (BundleLoadState)EditorGUILayout.EnumPopup(data.LoadState, TableStyles.ToolbarButton); GUILayout.Space(spacePixel); data.Publish = GUILayout.Toggle(data.Publish, " Publish"); GUILayout.Space(spacePixel); data.PushDependice = GUILayout.Toggle(data.PushDependice, " Push"); GUILayout.Space(spacePixel); data.SkipData = GUILayout.Toggle(data.SkipData, " SkipData"); GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(TableStyles.Toolbar); { if (GUILayout.Button("Move Up Priority", TableStyles.ToolbarButton, GUILayout.MaxWidth(120))) { m_control.ModifDataPriority(true); } if (GUILayout.Button("Move Down Priority", TableStyles.ToolbarButton, GUILayout.MaxWidth(120))) { m_control.ModifDataPriority(false); } if (GUILayout.Button("Refresh Path Data", TableStyles.ToolbarButton, GUILayout.MaxWidth(140))) { m_control.RefreshBaseData(); } if (GUILayout.Button("Create Bundle", TableStyles.ToolbarButton, GUILayout.MaxWidth(140))) { BundleAdapter.CreateBundles(); } // if (GUILayout.Button("Update By PackageDiff", TableStyles.ToolbarButton, GUILayout.MaxWidth(140))) { // PackagesDiff.LoadData(); // BundleAdapter.UpdateBundleBuildList(PackagesDiff.IsNeedUpdatePath); // } if (GUILayout.Button("Build Bundle", TableStyles.ToolbarButton, GUILayout.MaxWidth(140))) { BundleAdapter.BuildBundles(); } if (GUILayout.Button("Build Bundle All", TableStyles.ToolbarButton, GUILayout.MaxWidth(140))) { //BundleAdapter.UpdateBundleBuildList(null); //BundleAdapter.BuildBundles(); } GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); int startY = toolbarHeight + border; int height = (int)(r.height - startY - border * 2); if (m_dataTable != null) { m_dataTable.Draw(new Rect(border, startY, r.width - border, (int)(height * split - border * 1.5f))); } if (m_showTable != null) { m_showTable.Draw(new Rect(border, (int)(height * split + border * 0.5f + startY), r.width - border, (int)(height * (1.0f - split) - border * 1.5f))); } GUILayout.EndVertical(); //GUILayout.EndArea(); }