update CCK to 3.10, fixing unity 2021 crash :)
This commit is contained in:
parent
48a978fa2a
commit
d11e0fb3a9
492 changed files with 2165204 additions and 437687 deletions
|
@ -2,58 +2,38 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.XPath;
|
||||
using ABI.CCK.Components;
|
||||
using ABI.CCK.Scripts.Runtime;
|
||||
using Abi.Newtonsoft.Json;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEditor.UIElements;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace ABI.CCK.Scripts.Editor
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public class CCK_BuildManagerWindow : EditorWindow
|
||||
{
|
||||
public static string Version = "3.5 RELEASE";
|
||||
public static int BuildID = 98;
|
||||
private const string CCKVersion = "3.5 RELEASE (Build 98)";
|
||||
|
||||
private string[] SupportedUnityVersions = new[]
|
||||
{
|
||||
"2019.4.0f1", "2019.4.1f1", "2019.4.2f1", "2019.4.3f1", "2019.4.4f1", "2019.4.5f1", "2019.4.6f1",
|
||||
"2019.4.7f1", "2019.4.8f1", "2019.4.9f1", "2019.4.10f1", "2019.4.11f1", "2019.4.12f1",
|
||||
"2019.4.13f1", "2019.4.14f1", "2019.4.15f1", "2019.4.16f1", "2019.4.17f1", "2019.4.18f1",
|
||||
"2019.4.19f1", "2019.4.20f1", "2019.4.21f1", "2019.4.22f1", "2019.4.23f1", "2019.4.24f1",
|
||||
"2019.4.25f1", "2019.4.26f1", "2019.4.27f1", "2019.4.28f1", "2019.4.29f1", "2019.4.30f1",
|
||||
"2019.4.31f1",
|
||||
"2021.3.1f1", "2021.3.2f1", "2021.3.3f1", "2021.3.4f1", "2021.3.5f1", "2021.3.6f1", "2021.3.7f1",
|
||||
"2021.3.8f1", "2021.3.9f1", "2021.3.10f1", "2021.3.11f1", "2021.3.12f1", "2021.3.13f1", "2021.3.14f1",
|
||||
"2021.3.15f1", "2021.3.16f1", "2021.3.17f1", "2021.3.18f1", "2021.3.19f1", "2021.3.20f1", "2021.3.21f1",
|
||||
"2021.3.22f1", "2021.3.23f1", "2021.3.24f1"
|
||||
};
|
||||
|
||||
string _username;
|
||||
string _key;
|
||||
|
||||
private string _username;
|
||||
private string _key;
|
||||
|
||||
public Texture2D abiLogo;
|
||||
private bool _attemptingToLogin;
|
||||
private bool _loggedIn;
|
||||
private bool _hasAttemptedToLogin;
|
||||
private bool _allowedToUpload;
|
||||
//private bool _allowedToUpload;
|
||||
private string _apiUserRank;
|
||||
private string _apiCreatorRank;
|
||||
Vector2 scrollPosAvatar;
|
||||
Vector2 scrollPosSpawnable;
|
||||
Vector2 scrollPosWorld;
|
||||
//private string _apiCreatorRank;
|
||||
private Vector2 scrollPosAvatar;
|
||||
private Vector2 scrollPosSpawnable;
|
||||
|
||||
private int _tab;
|
||||
private Vector2 _scroll;
|
||||
|
@ -79,20 +59,20 @@ namespace ABI.CCK.Scripts.Editor
|
|||
}
|
||||
}
|
||||
|
||||
[MenuItem("Alpha Blend Interactive/Control Panel (Builder and Settings)", false, 200)]
|
||||
static void Init()
|
||||
[MenuItem("Alpha Blend Interactive/Control Panel", false, 200)]
|
||||
private static void Init()
|
||||
{
|
||||
CCK_BuildManagerWindow window = (CCK_BuildManagerWindow)GetWindow(typeof(CCK_BuildManagerWindow), false, $"CCK :: Control Panel");
|
||||
window.Show();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
private void OnDisable()
|
||||
{
|
||||
EditorApplication.update -= EditorUpdate;
|
||||
EditorApplication.playModeStateChanged -= OnEditorStateUpdated;
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
private void OnEnable()
|
||||
{
|
||||
abiLogo = (Texture2D) AssetDatabase.LoadAssetAtPath("Assets/ABI.CCK/GUIAssets/abibig.png", typeof(Texture2D));
|
||||
|
||||
|
@ -103,15 +83,15 @@ namespace ABI.CCK.Scripts.Editor
|
|||
|
||||
_username = EditorPrefs.GetString("m_ABI_Username");
|
||||
_key = EditorPrefs.GetString("m_ABI_Key");
|
||||
Login();
|
||||
_ = Login();
|
||||
}
|
||||
|
||||
void OnEditorStateUpdated(PlayModeStateChange state)
|
||||
private void OnEditorStateUpdated(PlayModeStateChange state)
|
||||
{
|
||||
if (state == PlayModeStateChange.EnteredEditMode)
|
||||
{
|
||||
EditorPrefs.SetBool("m_ABI_isBuilding", false);
|
||||
EditorPrefs.SetString("m_ABI_TempVersion", Version);
|
||||
EditorPrefs.SetString("m_ABI_TempVersion", CVRCommon.CCK_VERSION);
|
||||
|
||||
string[] filePaths = Directory.GetFiles(Application.dataPath + "/ABI.CCK/Resources/Cache/", "*.prefab");
|
||||
foreach (string filePath in filePaths)
|
||||
|
@ -172,12 +152,15 @@ namespace ABI.CCK.Scripts.Editor
|
|||
if (File.Exists(Application.dataPath + "/ABI.CCK/Resources/Cache/_CVRWorld.prefab"))up.asset = Resources.Load<GameObject>("Cache/_CVRWorld").GetComponent<CVRAssetInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
var centeredStyle = GUI.skin.GetStyle("Label");
|
||||
centeredStyle.alignment = TextAnchor.UpperCenter;
|
||||
|
||||
GUIStyle centeredStyle = new GUIStyle(GUI.skin.label)
|
||||
{
|
||||
alignment = TextAnchor.MiddleCenter,
|
||||
fixedHeight = 70, // Fixes size when Android
|
||||
};
|
||||
|
||||
GUILayout.Label(abiLogo, centeredStyle);
|
||||
EditorGUILayout.BeginVertical();
|
||||
|
||||
|
@ -220,7 +203,7 @@ namespace ABI.CCK.Scripts.Editor
|
|||
|
||||
if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_LOGIN_BUTTON")))
|
||||
{
|
||||
Login();
|
||||
_ = Login();
|
||||
}
|
||||
|
||||
if (_hasAttemptedToLogin && !_loggedIn)
|
||||
|
@ -235,7 +218,7 @@ namespace ABI.CCK.Scripts.Editor
|
|||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_INFOTEXT_AUTHENTICATED_AS"), _username);
|
||||
EditorGUILayout.LabelField(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_INFOTEXT_USER_RANK"), _apiUserRank);
|
||||
EditorGUILayout.LabelField("CCK version ", CCKVersion);
|
||||
EditorGUILayout.LabelField("CCK version ", CVRCommon.CCK_VERSION_FULL);
|
||||
EditorGUILayout.Space();
|
||||
if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_LOGOUT_BUTTON"))){
|
||||
bool logout = EditorUtility.DisplayDialog(
|
||||
|
@ -248,10 +231,34 @@ namespace ABI.CCK.Scripts.Editor
|
|||
EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_INFOTEXT_DOCUMENTATION"), MessageType.Info);
|
||||
if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_HEADING_DOCUMENTATION"))) Application.OpenURL("https://docs.abinteractive.net");
|
||||
EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_WARNING_FEEDBACK"), MessageType.Info);
|
||||
if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_HEADING_FEEDBACK"))) Application.OpenURL("https://hub.abinteractive.net/feedback");
|
||||
if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_HEADING_FEEDBACK"))) Application.OpenURL("https://feedback.abinteractive.net/");
|
||||
EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_WARNING_FOLDERPATH"), MessageType.Warning);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_HEADING_FOUNDCONTENT"), EditorStyles.boldLabel);
|
||||
|
||||
// Check if using a supported Unity version
|
||||
if (!SupportedUnityVersions.Contains(Application.unityVersion))
|
||||
{
|
||||
EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_WORLDS_ERROR_UNITY_UNSUPPORTED"), MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if OpenXR is needed
|
||||
#if PLATFORM_ANDROID
|
||||
if (!ABI.CCK.Dependencies.OpenXR.OpenXR_Configurator.IsImported())
|
||||
{
|
||||
EditorGUILayout.HelpBox("OpenXR needs to be imported prior to uploading Android content!", MessageType.Error);
|
||||
if (GUILayout.Button("Import OpenXR")) ABI.CCK.Dependencies.OpenXR.OpenXR_Configurator.RunConfiguration();
|
||||
return;
|
||||
}
|
||||
if (!ABI.CCK.Dependencies.OpenXR.OpenXR_Configurator.IsConfigured())
|
||||
{
|
||||
EditorGUILayout.HelpBox("OpenXR needs to be configured prior to uploading Android content!", MessageType.Error);
|
||||
if (GUILayout.Button("Configure OpenXR")) ABI.CCK.Dependencies.OpenXR.OpenXR_Configurator.RunConfiguration();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
List<CVRAvatar> avatars = new List<CVRAvatar>();
|
||||
List<CVRSpawnable> spawnables = new List<CVRSpawnable>();
|
||||
List<CVRWorld> worlds = new List<CVRWorld>();
|
||||
|
@ -270,8 +277,8 @@ namespace ABI.CCK.Scripts.Editor
|
|||
{
|
||||
if (a.gameObject.activeInHierarchy) avatars.Add(a);
|
||||
}
|
||||
|
||||
if (worlds.Count <= 0 && avatars.Count > 0 && SupportedUnityVersions.Contains(Application.unityVersion))
|
||||
|
||||
if (worlds.Count <= 0 && avatars.Count > 0)
|
||||
{
|
||||
if (avatars.Count <= 0) EditorGUILayout.LabelField(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_UPLOADER_NO_AVATARS_FOUND"));
|
||||
else
|
||||
|
@ -293,7 +300,7 @@ namespace ABI.CCK.Scripts.Editor
|
|||
}
|
||||
}
|
||||
}
|
||||
if (worlds.Count <= 0 && spawnables.Count > 0 && SupportedUnityVersions.Contains(Application.unityVersion))
|
||||
if (worlds.Count <= 0 && spawnables.Count > 0)
|
||||
{
|
||||
if (spawnables.Count <= 0) EditorGUILayout.LabelField(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_UPLOADER_NO_SPAWNABLES_FOUND"));
|
||||
else
|
||||
|
@ -315,7 +322,7 @@ namespace ABI.CCK.Scripts.Editor
|
|||
}
|
||||
}
|
||||
}
|
||||
if (avatars.Count <= 0 && worlds.Count == 1 && SupportedUnityVersions.Contains(Application.unityVersion))
|
||||
if (avatars.Count <= 0 && worlds.Count == 1)
|
||||
{
|
||||
int errors = 0;
|
||||
int overallMissingScripts = 0;
|
||||
|
@ -337,31 +344,28 @@ namespace ABI.CCK.Scripts.Editor
|
|||
|
||||
if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_UPLOAD_WORLD_BUTTON")) && errors <= 0)
|
||||
{
|
||||
CCK_BuildUtility.BuildAndUploadMapAsset(EditorSceneManager.GetActiveScene(), worlds[0].gameObject);
|
||||
_ = CCK_BuildUtility.BuildAndUploadMapAsset(EditorSceneManager.GetActiveScene(), worlds[0].gameObject);
|
||||
}
|
||||
if (overallMissingScripts > 0) if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_UTIL_REMOVE_MISSING_SCRIPTS_BUTTON"))) CCK_Tools.CleanMissingScripts(CCK_Tools.SearchType.Scene , true, null);
|
||||
}
|
||||
if (avatars.Count <= 0 && worlds.Count > 1 && SupportedUnityVersions.Contains(Application.unityVersion))
|
||||
if (avatars.Count <= 0 && worlds.Count > 1)
|
||||
{
|
||||
EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_WORLDS_ERROR_MULTIPLE_CVR_WORLD"), MessageType.Error);
|
||||
}
|
||||
if (avatars.Count > 0 && worlds.Count > 0 && SupportedUnityVersions.Contains(Application.unityVersion))
|
||||
if (avatars.Count > 0 && worlds.Count > 0)
|
||||
{
|
||||
EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_WORLDS_ERROR_WORLD_CONTAINS_AVATAR"), MessageType.Error);
|
||||
}
|
||||
if (avatars.Count <= 0 && worlds.Count <= 0 && SupportedUnityVersions.Contains(Application.unityVersion))
|
||||
if (avatars.Count <= 0 && worlds.Count <= 0)
|
||||
{
|
||||
EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_WORLDS_ERROR_NO_CONTENT"), MessageType.Info);
|
||||
}
|
||||
if (!SupportedUnityVersions.Contains(Application.unityVersion))
|
||||
{
|
||||
EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_WORLDS_ERROR_UNITY_UNSUPPORTED"), MessageType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
void Tab_Settings()
|
||||
private void Tab_Settings()
|
||||
{
|
||||
EditorGUILayout.LabelField(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_SETTINGS_HEADER"), EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("CCK version ", CVRCommon.CCK_VERSION);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
@ -398,11 +402,10 @@ namespace ABI.CCK.Scripts.Editor
|
|||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_SETTINGS_HINT_CCK_LANGUAGE"), MessageType.Info);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
|
||||
void OnGUIAvatar(CVRAvatar avatar)
|
||||
|
||||
private void OnGUIAvatar(CVRAvatar avatar)
|
||||
{
|
||||
GameObject avatarObject = avatar.gameObject;
|
||||
GUI.enabled = true;
|
||||
|
@ -462,12 +465,12 @@ namespace ABI.CCK.Scripts.Editor
|
|||
if (avatar.viewPosition.y <= 0.5f) EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_AVATAR_INFO_SMALL"), MessageType.Info);
|
||||
if (avatar.viewPosition.y > 3f) EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_AVATAR_INFO_HUGE"), MessageType.Info);
|
||||
|
||||
if (errors <= 0) if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_AVATAR_UPLOAD_BUTTON"))) CCK_BuildUtility.BuildAndUploadAvatar(avatarObject);
|
||||
if (errors <= 0) if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_AVATAR_UPLOAD_BUTTON"))) _ = CCK_BuildUtility.BuildAndUploadAvatar(avatarObject);
|
||||
if (overallMissingScripts > 0) if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_UTIL_REMOVE_MISSING_SCRIPTS_BUTTON"))) CCK_Tools.CleanMissingScripts(CCK_Tools.SearchType.Selection ,true,avatarObject);
|
||||
|
||||
}
|
||||
|
||||
void OnGUISpawnable(CVRSpawnable s)
|
||||
|
||||
private void OnGUISpawnable(CVRSpawnable s)
|
||||
{
|
||||
GameObject spawnableObject = s.gameObject;
|
||||
GUI.enabled = true;
|
||||
|
@ -512,7 +515,7 @@ namespace ABI.CCK.Scripts.Editor
|
|||
if (overallSkinnedMeshRenderer >= 5 && overallSkinnedMeshRenderer <= 10) EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_PROPS_INFO_SKINNED_MESH_RENDERERS").Replace("{X}", overallSkinnedMeshRenderer.ToString()), MessageType.Info);
|
||||
if (overallUniqueMaterials >= 10 && overallUniqueMaterials <= 20) EditorGUILayout.HelpBox(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_PROPS_INFO_MATERIALS").Replace("{X}", overallUniqueMaterials.ToString()), MessageType.Info);
|
||||
|
||||
if (errors <= 0 && overallMissingScripts <= 0) if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_PROPS_UPLOAD_BUTTON"))) CCK_BuildUtility.BuildAndUploadSpawnable(spawnableObject);
|
||||
if (errors <= 0 && overallMissingScripts <= 0) if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_PROPS_UPLOAD_BUTTON"))) _ = CCK_BuildUtility.BuildAndUploadSpawnable(spawnableObject);
|
||||
if (overallMissingScripts > 0) if (GUILayout.Button(CCKLocalizationProvider.GetLocalizedText("ABI_UI_BUILDPANEL_UTIL_REMOVE_MISSING_SCRIPTS_BUTTON"))) CCK_Tools.CleanMissingScripts(CCK_Tools.SearchType.Selection ,true, spawnableObject);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue