AssetPublishEditor.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.AddressableAssets;
  4. using UnityEngine.Serialization;
  5. namespace UnityEditor.AddressableAssets.GUI
  6. {
  7. [Serializable]
  8. class AssetPublishEditor
  9. {
  10. [FormerlySerializedAs("scrollPosition")]
  11. [SerializeField]
  12. Vector2 m_ScrollPosition;
  13. [FormerlySerializedAs("fullBuildFoldout")]
  14. [SerializeField]
  15. bool m_FullBuildFoldout = true;
  16. [FormerlySerializedAs("updateFoldout")]
  17. [SerializeField]
  18. bool m_UpdateFoldout = true;
  19. [FormerlySerializedAs("snapshotPath")]
  20. [SerializeField]
  21. string m_SnapshotPath = "/Snapshots/ABuildSnapshot";
  22. public bool OnGUI(Rect pos)
  23. {
  24. GUILayout.BeginArea(pos);
  25. m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition, false, false, GUILayout.MaxWidth(pos.width));
  26. GUILayout.Space(20);
  27. GUILayout.Label(" NOT YET FUNCTIONAL ");
  28. GUILayout.Space(10);
  29. m_FullBuildFoldout = EditorGUILayout.Foldout(m_FullBuildFoldout, "Full Build");
  30. if (m_FullBuildFoldout)
  31. {
  32. EditorGUI.indentLevel++;
  33. EditorGUILayout.HelpBox(new GUIContent("This section will create a rebuild of all content packs as well as the core player build. A snapshot of this build must be saved in order to do updates to it later."));
  34. GUILayout.BeginHorizontal();
  35. GUILayout.FlexibleSpace();
  36. if (GUILayout.Button("Build and Save Snapshot"))
  37. {
  38. Addressables.Log("we aren't actually building yet.");
  39. }
  40. GUILayout.EndHorizontal();
  41. EditorGUI.indentLevel--;
  42. }
  43. GUILayout.Space(20);
  44. m_UpdateFoldout = EditorGUILayout.Foldout(m_UpdateFoldout, "Update Build");
  45. if (m_UpdateFoldout)
  46. {
  47. EditorGUI.indentLevel++;
  48. EditorGUILayout.HelpBox(new GUIContent("This section will not create a core player build, and it will only create the new bundles needed when compared to a given snapshot."));
  49. GUILayout.BeginHorizontal();
  50. m_SnapshotPath = EditorGUILayout.TextField(new GUIContent("Reference Snapshot"), m_SnapshotPath);
  51. GUILayout.Space(10);
  52. if (GUILayout.Button("Browse"))
  53. {
  54. Addressables.Log("we aren't actually browsing yet.");
  55. }
  56. GUILayout.EndHorizontal();
  57. GUILayout.BeginHorizontal();
  58. GUILayout.FlexibleSpace();
  59. if (GUILayout.Button("Create Updated Packs"))
  60. {
  61. Addressables.Log("we aren't actually updating yet.");
  62. }
  63. GUILayout.EndHorizontal();
  64. EditorGUI.indentLevel--;
  65. }
  66. EditorGUILayout.EndScrollView();
  67. GUILayout.EndArea();
  68. return false;
  69. }
  70. internal void OnEnable()
  71. {
  72. }
  73. internal void OnDisable()
  74. {
  75. }
  76. }
  77. }