Fixed build warnings
This commit is contained in:
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
+2
-2
@@ -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}";
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user