Question by
lorenzosindoni · Aug 30, 2021 at 06:30 PM ·
scripting problemtimetimertime.deltatimetimer-script
How is it possible to verify values and is they are correct activate objects ?
Hi,
I need your help to complete my script. I want to verify values that are detected in real-time and if they are inside the range for at least 3 seconds activate objects inside the scene.
this is the code that I have actually:
private void ReadValue(int[][] packageOfData, int chnIndex)
{
for (int i = 0; i < packageOfData.Length; i++)
{
// First stage condition
if (packageOfData[i][chnIndex] < 800 && packageOfData[i][chnIndex] > 400)
{
if (Aura != null)
{
Aura.SetActive(false);
}
if (AuraGlow != null)
{
AuraGlow.SetActive(false);
}
if (DirectionalLight != null)
{
DirectionalLight.transform.rotation = Quaternion.Slerp(point0.rotation, pointA.rotation, timeCount);
timeCount = timeCount + Time.deltaTime;
}
}
Comment