Merge pull request 'MAVRIC-2222 updated document script to accept standard and URP rendering' (#21) from bugfix/MAVRIC-2222_Fix_Documents_Not_Changing into development

Reviewed-on: http://104.1.10.149:3000/MAVRIC/Stratasys-Fortus-450mc/pulls/21
Reviewed-by: Caleb Brown <caleb.brown@udri.udayton.edu>
Reviewed-by: Joshua Latham <joshua.latham@udri.udayton.edu>
This commit is contained in:
Joshua Latham 2023-12-04 13:57:16 +00:00
commit 1887d5df56
2 changed files with 13 additions and 0 deletions

View File

@ -2252,6 +2252,10 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 2995049788487289996}
m_Modifications:
- target: {fileID: 252390269528597581, guid: 5e629b36dd520da42a7d3b0c54050ea4, type: 3}
propertyPath: isURP
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1327698172346070804, guid: 5e629b36dd520da42a7d3b0c54050ea4, type: 3}
propertyPath: m_RootOrder
value: -1

View File

@ -10,8 +10,11 @@ namespace Managers
[SerializeField] private StepChangeChannelSO stepChangeChannel;
[SerializeField] private SimpleChannelSO documentLoadedChannel;
[SerializeField] private Material currentImage;
[SerializeField] private bool isURP;
private const string MainText = "_MainTex";
private const string BaseMap = "_BaseMap";
private static readonly int MainTex = Shader.PropertyToID(MainText);
private static readonly int BaseMapTex = Shader.PropertyToID(BaseMap);
private void OnEnable()
{
@ -25,6 +28,12 @@ namespace Managers
private void OnStepChanged(StepSO step)
{
if (isURP)
{
currentImage.SetTexture(BaseMapTex, step.Document);
documentLoadedChannel.RaiseEvent();
return;
}
currentImage.SetTexture(MainTex, step.Document);
documentLoadedChannel.RaiseEvent();
}