diff --git a/Assets/Scenes/Main Scene.unity b/Assets/Scenes/Main Scene.unity index 8efa385..fc7704d 100644 --- a/Assets/Scenes/Main Scene.unity +++ b/Assets/Scenes/Main Scene.unity @@ -964,7 +964,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Enabled - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_DrawHalo @@ -972,7 +972,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Intensity - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_SpotAngle @@ -1220,7 +1220,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Enabled - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_DrawHalo @@ -1228,7 +1228,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Intensity - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_SpotAngle @@ -1348,7 +1348,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Enabled - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_DrawHalo @@ -1356,7 +1356,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Intensity - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_SpotAngle @@ -1624,7 +1624,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Enabled - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_DrawHalo @@ -1632,7 +1632,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Intensity - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_SpotAngle @@ -1736,11 +1736,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -2219006240209657379, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_LocalPosition.x - value: 0.00317 + value: 0.00312 objectReference: {fileID: 0} - target: {fileID: -2219006240209657379, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_LocalPosition.y - value: -0.00137 + value: -0.00134 objectReference: {fileID: 0} - target: {fileID: -2219006240209657379, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_LocalPosition.z @@ -1992,7 +1992,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Enabled - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_DrawHalo @@ -2000,7 +2000,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Intensity - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_SpotAngle @@ -2308,7 +2308,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Enabled - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_DrawHalo @@ -2316,7 +2316,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Intensity - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_SpotAngle @@ -2344,19 +2344,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_BoundingSphereOverride.w - value: 9e-44 + value: 1.83716e-40 objectReference: {fileID: 0} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_BoundingSphereOverride.x - value: 0 + value: 2.2227777e-38 objectReference: {fileID: 0} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_BoundingSphereOverride.y - value: -1.8414724e+37 + value: 9.1858e-41 objectReference: {fileID: 0} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_BoundingSphereOverride.z - value: 2.5e-44 + value: -2.4405384e-30 objectReference: {fileID: 0} - target: {fileID: 3668888808494289767, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Enabled @@ -2572,7 +2572,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Enabled - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_DrawHalo @@ -2580,7 +2580,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Intensity - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_SpotAngle @@ -2664,7 +2664,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Enabled - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_DrawHalo @@ -2672,7 +2672,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_Intensity - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} propertyPath: m_SpotAngle diff --git a/Assets/Scripts/LedSerial.cs b/Assets/Scripts/LedSerial.cs index 273c8b4..9a8574c 100644 --- a/Assets/Scripts/LedSerial.cs +++ b/Assets/Scripts/LedSerial.cs @@ -20,7 +20,6 @@ public class LedSerial : MonoBehaviour public float DisplayLedIntensity = 0.0f; Color32 PrevFadeColor; Color32 nowCorlor; - float FadeTime = 0.0f; void Start() { Debug.Log("Started LED Serial"); @@ -74,20 +73,16 @@ public class LedSerial : MonoBehaviour } } } + void SeperatData(List data) { if (data[0] == 57) - { dataListStreamP1.Add(data); - } else if (data[0] == 60) - { isUpdateCMD = true; - } - else if (!isUpdateCMD) - { + + if (!isUpdateCMD) dataListInstantP1.Add(data); - } } List ReadData(SerialPort Serial) @@ -102,7 +97,6 @@ public class LedSerial : MonoBehaviour void UpdateLedListStream(ref List> dataList, List ringLeds, Light bodyLed, Light displayLed) { - if (dataList.Count < 1) return; UpdateLED(dataList[0], ringLeds, bodyLed, displayLed); @@ -110,11 +104,9 @@ public class LedSerial : MonoBehaviour if (dataList.Count > 64) dataList.Clear(); } + void UpdateLedListInstant(ref List> dataList, List ringLeds, Light bodyLed, Light displayLed) { - - if (dataList.Count < 1) - return; while (dataList.Count > 0) { UpdateLED(dataList[0], ringLeds, bodyLed, displayLed); @@ -148,7 +140,10 @@ public class LedSerial : MonoBehaviour if (data[0]==50) Switch(data[1], data[2], ringLeds, nowCorlor); else + { + StopCoroutine(Fade(data[1], data[2], ringLeds, PrevFadeColor, nowCorlor, data[7])); StartCoroutine(Fade(data[1], data[2], ringLeds, PrevFadeColor, nowCorlor, data[7])); + } PrevFadeColor = nowCorlor; break; case 57: