Fixed build warnings

This commit is contained in:
Jedd Morgan
2023-04-11 21:14:35 +01:00
parent 9f3145eb19
commit 9a89255ae8
6 changed files with 7 additions and 7 deletions
@@ -291,13 +291,13 @@ namespace Speckle.ConnectorUnity.Components
public void Awake()
{
CoreUtils.SetupInit();
Converter = GetComponent<RecursiveConverter>();
Initialise(true);
}
protected void Initialise(bool forceRefresh = false)
{
CoreUtils.SetupInit();
Account ??= new AccountSelection();
Stream ??= new StreamSelection(Account);
Branch ??= new BranchSelection(Stream);
@@ -179,13 +179,13 @@ namespace Speckle.ConnectorUnity.Components
public void Awake()
{
CoreUtils.SetupInit();
Initialise(true);
Converter = GetComponent<RecursiveConverter>();
}
protected void Initialise(bool forceRefresh = false)
{
CoreUtils.SetupInit();
Account ??= new AccountSelection();
Stream ??= new StreamSelection(Account);
Branch ??= new BranchSelection(Stream);
@@ -252,7 +252,7 @@ namespace Objects.Converter.Unity
if(!TryGetMeshFromCache(instance.definition, meshes, out Mesh? nativeMesh, out _))
{
MeshToNativeMesh(meshes, out nativeMesh);
string name = AssetHelpers.GetObjectName(instance.definition);
string name = AssetHelpers.GenerateObjectName(instance.definition);
nativeMesh.name = name;
LoadedAssets.TrySaveObject(instance.definition, nativeMesh);
}
@@ -223,7 +223,7 @@ namespace Objects.Converter.Unity
{
//Convert a new one
MeshToNativeMesh(meshes, out nativeMesh, out center);
string name = AssetHelpers.GetObjectName(element);
string name = AssetHelpers.GenerateObjectName(element);
nativeMesh.name = name;
LoadedAssets.TrySaveObject(element, nativeMesh);
}
@@ -483,7 +483,7 @@ namespace Objects.Converter.Unity
var c = renderMaterial.diffuse.ToUnityColor();
mat.color = new Color(c.r, c.g, c.b, (float) renderMaterial.opacity);
mat.name = AssetHelpers.GetObjectName(renderMaterial);
mat.name = AssetHelpers.GenerateObjectName(renderMaterial);
mat.SetFloat(Metallic, (float) renderMaterial.metalness);
mat.SetFloat(Glossiness, 1 - (float) renderMaterial.roughness);
if (renderMaterial.emissive != SColor.Black.ToArgb()) mat.EnableKeyword("_EMISSION");
@@ -69,7 +69,7 @@ namespace Speckle.ConnectorUnity.NativeCache
public static string GetAssetName(Base speckleObject, Type nativeType)
{
string suffix = GetAssetSuffix(nativeType);
string name = GetObjectName(speckleObject);
string name = GenerateObjectName(speckleObject);
string sanitisedName = new(name.Where(x => !InvalidChars.Contains(x)).ToArray());
return $"{sanitisedName}{suffix}";
@@ -18,7 +18,7 @@ namespace Speckle.ConnectorUnity.Wrappers.Selection
{
Account? account = Selected;
if (account == null) return client = null;
if (client == null || !client.Account.Equals(account)) return client = new Client(Selected);
if (client == null || !client.Account.Equals(account)) return client = new Client(account);
return client;
}
}