1
0
mirror of https://github.com/xiaopeng12138/MaiDXR.git synced 2025-02-07 15:01:21 +01:00

fix some led issues

This commit is contained in:
xpeng 2022-07-24 17:11:12 +02:00
parent 90ca2e368a
commit 518bb0cdde
2 changed files with 29 additions and 34 deletions

View File

@ -964,7 +964,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_DrawHalo propertyPath: m_DrawHalo
@ -972,7 +972,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity propertyPath: m_Intensity
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_SpotAngle propertyPath: m_SpotAngle
@ -1220,7 +1220,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_DrawHalo propertyPath: m_DrawHalo
@ -1228,7 +1228,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity propertyPath: m_Intensity
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_SpotAngle propertyPath: m_SpotAngle
@ -1348,7 +1348,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_DrawHalo propertyPath: m_DrawHalo
@ -1356,7 +1356,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity propertyPath: m_Intensity
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_SpotAngle propertyPath: m_SpotAngle
@ -1624,7 +1624,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_DrawHalo propertyPath: m_DrawHalo
@ -1632,7 +1632,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity propertyPath: m_Intensity
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_SpotAngle propertyPath: m_SpotAngle
@ -1736,11 +1736,11 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -2219006240209657379, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -2219006240209657379, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0.00317 value: 0.00312
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -2219006240209657379, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -2219006240209657379, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: -0.00137 value: -0.00134
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -2219006240209657379, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -2219006240209657379, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
@ -1992,7 +1992,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_DrawHalo propertyPath: m_DrawHalo
@ -2000,7 +2000,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity propertyPath: m_Intensity
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_SpotAngle propertyPath: m_SpotAngle
@ -2308,7 +2308,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_DrawHalo propertyPath: m_DrawHalo
@ -2316,7 +2316,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity propertyPath: m_Intensity
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_SpotAngle propertyPath: m_SpotAngle
@ -2344,19 +2344,19 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_BoundingSphereOverride.w propertyPath: m_BoundingSphereOverride.w
value: 9e-44 value: 1.83716e-40
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_BoundingSphereOverride.x propertyPath: m_BoundingSphereOverride.x
value: 0 value: 2.2227777e-38
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_BoundingSphereOverride.y propertyPath: m_BoundingSphereOverride.y
value: -1.8414724e+37 value: 9.1858e-41
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_BoundingSphereOverride.z propertyPath: m_BoundingSphereOverride.z
value: 2.5e-44 value: -2.4405384e-30
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3668888808494289767, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3668888808494289767, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
@ -2572,7 +2572,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_DrawHalo propertyPath: m_DrawHalo
@ -2580,7 +2580,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity propertyPath: m_Intensity
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_SpotAngle propertyPath: m_SpotAngle
@ -2664,7 +2664,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_DrawHalo propertyPath: m_DrawHalo
@ -2672,7 +2672,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity propertyPath: m_Intensity
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_SpotAngle propertyPath: m_SpotAngle

View File

@ -20,7 +20,6 @@ public class LedSerial : MonoBehaviour
public float DisplayLedIntensity = 0.0f; public float DisplayLedIntensity = 0.0f;
Color32 PrevFadeColor; Color32 PrevFadeColor;
Color32 nowCorlor; Color32 nowCorlor;
float FadeTime = 0.0f;
void Start() void Start()
{ {
Debug.Log("Started LED Serial"); Debug.Log("Started LED Serial");
@ -74,20 +73,16 @@ public class LedSerial : MonoBehaviour
} }
} }
} }
void SeperatData(List<byte> data) void SeperatData(List<byte> data)
{ {
if (data[0] == 57) if (data[0] == 57)
{
dataListStreamP1.Add(data); dataListStreamP1.Add(data);
}
else if (data[0] == 60) else if (data[0] == 60)
{
isUpdateCMD = true; isUpdateCMD = true;
}
else if (!isUpdateCMD) if (!isUpdateCMD)
{
dataListInstantP1.Add(data); dataListInstantP1.Add(data);
}
} }
List<byte> ReadData(SerialPort Serial) List<byte> ReadData(SerialPort Serial)
@ -102,7 +97,6 @@ public class LedSerial : MonoBehaviour
void UpdateLedListStream(ref List<List<byte>> dataList, List<Light> ringLeds, Light bodyLed, Light displayLed) void UpdateLedListStream(ref List<List<byte>> dataList, List<Light> ringLeds, Light bodyLed, Light displayLed)
{ {
if (dataList.Count < 1) if (dataList.Count < 1)
return; return;
UpdateLED(dataList[0], ringLeds, bodyLed, displayLed); UpdateLED(dataList[0], ringLeds, bodyLed, displayLed);
@ -110,11 +104,9 @@ public class LedSerial : MonoBehaviour
if (dataList.Count > 64) if (dataList.Count > 64)
dataList.Clear(); dataList.Clear();
} }
void UpdateLedListInstant(ref List<List<byte>> dataList, List<Light> ringLeds, Light bodyLed, Light displayLed) void UpdateLedListInstant(ref List<List<byte>> dataList, List<Light> ringLeds, Light bodyLed, Light displayLed)
{ {
if (dataList.Count < 1)
return;
while (dataList.Count > 0) while (dataList.Count > 0)
{ {
UpdateLED(dataList[0], ringLeds, bodyLed, displayLed); UpdateLED(dataList[0], ringLeds, bodyLed, displayLed);
@ -148,7 +140,10 @@ public class LedSerial : MonoBehaviour
if (data[0]==50) if (data[0]==50)
Switch(data[1], data[2], ringLeds, nowCorlor); Switch(data[1], data[2], ringLeds, nowCorlor);
else else
{
StopCoroutine(Fade(data[1], data[2], ringLeds, PrevFadeColor, nowCorlor, data[7]));
StartCoroutine(Fade(data[1], data[2], ringLeds, PrevFadeColor, nowCorlor, data[7])); StartCoroutine(Fade(data[1], data[2], ringLeds, PrevFadeColor, nowCorlor, data[7]));
}
PrevFadeColor = nowCorlor; PrevFadeColor = nowCorlor;
break; break;
case 57: case 57: