Properly scale the placed element's material
parent
16a9f846af
commit
84f6a7d690
|
@ -27,6 +27,12 @@ public class SimpleResizer
|
|||
prefab.transform.localPosition = Vector3.zero;
|
||||
prefab.transform.localRotation = Quaternion.identity;
|
||||
|
||||
// Marc Scale fix
|
||||
// Calculate the texture scale based on the ratio of new size to default size
|
||||
Vector2 textureScale = new Vector2(newSize.x / resizable.DefaultSize.x, newSize.y / resizable.DefaultSize.y);
|
||||
prefab.GetComponent<Renderer>().material.mainTextureScale = textureScale;
|
||||
|
||||
|
||||
// cleanup
|
||||
MonoBehaviour.Destroy(resizable);
|
||||
}
|
||||
|
|
|
@ -139,8 +139,6 @@ PlayerSettings:
|
|||
bundleVersion: 0.1
|
||||
preloadedAssets:
|
||||
- {fileID: 11400000, guid: 29d72bf9f28086693968cedbdc8f08cd, type: 2}
|
||||
- {fileID: 11400000, guid: 541751c4fa90967d68ef779a22ee43f3, type: 2}
|
||||
- {fileID: -3127938587913570544, guid: 8eb28e39ec717d0799039f01965f0533, type: 2}
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
|
|
Loading…
Reference in New Issue