Skip to content

Commit 4241670

Browse files
committed
Added TrySetFramesDelay(int), TrySetThresholdMinColor and TrySetThresholdMaxColor
1 parent a04f8bf commit 4241670

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Packages/webxr-interactions/Runtime/Scripts/MixedRealityCaptureController.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ public void TrySetFramesDelay(string value)
170170
}
171171
}
172172

173+
public void TrySetFramesDelay(int value)
174+
{
175+
if ((state == ControllerState.None || state == ControllerState.Ended))
176+
{
177+
webcamFramesDelaySize = Mathf.Clamp(value + 1, 0, 100);
178+
}
179+
}
180+
173181
private void TryUpdateControllerState()
174182
{
175183
bool enableState = enableInXR && currentXRState != WebXRState.NORMAL;

Packages/webxr-interactions/Runtime/Scripts/PlayWebcam.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,28 @@ public void TrySetMaxB(string value)
191191
TrySetColor(value, ref thresholdMaxColor, thresholdMaxID, 2);
192192
}
193193

194+
public void TrySetThresholdMinColor(Color color)
195+
{
196+
TrySetupRenderer();
197+
if (hasThresholdProperties)
198+
{
199+
color.a = thresholdMinColor.a;
200+
thresholdMinColor = color;
201+
material.SetColor(thresholdMinID, thresholdMinColor);
202+
}
203+
}
204+
205+
public void TrySetThresholdMaxColor(Color color)
206+
{
207+
TrySetupRenderer();
208+
if (hasThresholdProperties)
209+
{
210+
color.a = thresholdMaxColor.a;
211+
thresholdMaxColor = color;
212+
material.SetColor(thresholdMaxID, thresholdMaxColor);
213+
}
214+
}
215+
194216
public void TrySetLightingTexture(Texture texture)
195217
{
196218
if (lightingTexID == -1)

0 commit comments

Comments
 (0)