Fix Sidekick tool startup and path handling
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Synty.SidekickCharacters
|
||||
private const string _AUTOSAVE_MISSING_PARTS = "SK_Autosave_missing_parts";
|
||||
private const string _AUTOSAVE_STATE = "SK_Autosave_state";
|
||||
private const string _BASE_COLOR_SET_NAME = "Species";
|
||||
private const string _BASE_COLOR_SET_PATH = "Assets/Synty/SidekickCharacters/Resources/Species";
|
||||
private const string _BASE_COLOR_SET_PATH = "Assets/External/Models/SidekickCharacters/Resources/Species";
|
||||
private const string _BASE_MESH_NAME = "Meshes/SK_BaseModel";
|
||||
private const string _BASE_MATERIAL_NAME = "Materials/M_BaseMaterial";
|
||||
private const string _BLEND_GENDER_NAME = "masculineFeminine";
|
||||
@@ -121,7 +121,7 @@ namespace Synty.SidekickCharacters
|
||||
private bool _showAllColourProperties = false;
|
||||
private float _bodyTypeBlendValue;
|
||||
private bool _loadingCharacter = false;
|
||||
private bool _loadingContent = true;
|
||||
private bool _loadingContent = false;
|
||||
private Image _loadingImage;
|
||||
private ObjectField _materialField;
|
||||
private float _musclesBlendValue;
|
||||
@@ -192,7 +192,7 @@ namespace Synty.SidekickCharacters
|
||||
}
|
||||
|
||||
// ensures we release the file lock on the database
|
||||
_dbManager.CloseConnection();
|
||||
_dbManager?.CloseConnection();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
@@ -211,7 +211,7 @@ namespace Synty.SidekickCharacters
|
||||
/// <inheritdoc cref="Update" />
|
||||
private void Update()
|
||||
{
|
||||
if (_loadingContent)
|
||||
if (_loadingContent && _loadingImage != null)
|
||||
{
|
||||
Vector3 rotation = _loadingImage.transform.rotation.eulerAngles;
|
||||
rotation += new Vector3(0, 0, 0.5f * Time.deltaTime);
|
||||
@@ -473,6 +473,7 @@ namespace Synty.SidekickCharacters
|
||||
// if we still can't connect, something's gone wrong, don't keep building the GUI
|
||||
if (_dbManager?.GetCurrentDbConnection() == null)
|
||||
{
|
||||
_loadingContent = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1814,7 +1815,12 @@ namespace Synty.SidekickCharacters
|
||||
|
||||
documentationButton.clickable.clicked += delegate
|
||||
{
|
||||
Application.OpenURL("file:Assets/Synty/SidekickCharacters/Documentation/SidekickCharacters_UserGuide.pdf");
|
||||
string documentationPath = Path.Combine(DatabaseManager.GetPackageRootAbsolutePath() ?? string.Empty, "Documentation", "SidekickCharacters_UserGuide.pdf");
|
||||
documentationPath = Path.GetFullPath(documentationPath);
|
||||
if (File.Exists(documentationPath))
|
||||
{
|
||||
Application.OpenURL("file:" + documentationPath);
|
||||
}
|
||||
};
|
||||
|
||||
Button storeButton = new Button
|
||||
@@ -1919,7 +1925,8 @@ namespace Synty.SidekickCharacters
|
||||
/// </summary>
|
||||
private void SaveColorSet()
|
||||
{
|
||||
string path = Path.Combine(_BASE_COLOR_SET_PATH, _currentSpecies.Name);
|
||||
string baseColorSetPath = DatabaseManager.GetPackageAssetPath("Resources", "Species") ?? _BASE_COLOR_SET_PATH;
|
||||
string path = Path.Combine(baseColorSetPath, _currentSpecies.Name);
|
||||
path = Path.Combine(path, _currentColorSet.Name.Replace(" ", "_"));
|
||||
|
||||
SaveTexturesToDisk(path);
|
||||
|
||||
Reference in New Issue
Block a user