Honor semantic scale for provider prefabs
This commit is contained in:
parent
8d628a6599
commit
ccb5817a60
2 changed files with 3 additions and 5 deletions
|
|
@ -239,9 +239,7 @@ namespace GameCult.Eve.UnityScene
|
|||
: $"{entity.EntityId} ({entity.Label})";
|
||||
instance.transform.localPosition = new Vector3(entity.PositionX, entity.PositionY, entity.PositionZ);
|
||||
instance.transform.localRotation = Quaternion.Euler(0f, entity.RotationY, 0f);
|
||||
if (entity.Radius > 0f &&
|
||||
string.Equals(asset.PresentationKind, "unity-generated-placeholder", StringComparison.Ordinal))
|
||||
instance.transform.localScale = Vector3.one * entity.Radius;
|
||||
instance.transform.localScale = Vector3.one * (entity.Radius > 0f ? entity.Radius : 1f);
|
||||
|
||||
var marker = instance.GetComponent<EveUnityPlayableWorldEntityMarker>();
|
||||
if (marker == null)
|
||||
|
|
|
|||
|
|
@ -1345,7 +1345,7 @@ namespace GameCult.Eve.UnityScene.Tests
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void ProviderPrefabKeepsAuthoredScaleWhileFallbackUsesSemanticRadius()
|
||||
public void SemanticScaleWrapsProviderAuthoredScaleAndFallbackGeometry()
|
||||
{
|
||||
var root = new GameObject("world");
|
||||
var prefab = new GameObject("provider-prefab");
|
||||
|
|
@ -1360,7 +1360,7 @@ namespace GameCult.Eve.UnityScene.Tests
|
|||
"prefab.ship", "ship", "provider-asset-ref"));
|
||||
|
||||
var instance = root.transform.GetChild(0);
|
||||
Assert.That(instance.localScale, Is.EqualTo(Vector3.one));
|
||||
Assert.That(instance.localScale, Is.EqualTo(Vector3.one * 12f));
|
||||
Assert.That(instance.GetChild(0).localScale, Is.EqualTo(new Vector3(2f, 3f, 4f)));
|
||||
|
||||
var fallbackSink = new EveUnityGameObjectPlayableWorldSceneSink(
|
||||
|
|
|
|||
Reference in a new issue