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

v0.6 update

This commit is contained in:
xpeng 2022-02-17 00:21:32 +01:00
parent 0565fbadbe
commit 056a5e9287
5 changed files with 355 additions and 18 deletions

Binary file not shown.

View File

@ -259,6 +259,16 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 8 m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &101046485 stripped
Light:
m_CorrespondingSourceObject: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
m_PrefabInstance: {fileID: 856927026}
m_PrefabAsset: {fileID: 0}
--- !u!108 &129506686 stripped
Light:
m_CorrespondingSourceObject: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
m_PrefabInstance: {fileID: 856927026}
m_PrefabAsset: {fileID: 0}
--- !u!1 &141732345 --- !u!1 &141732345
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -947,6 +957,11 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 5 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &852770257 stripped
Light:
m_CorrespondingSourceObject: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
m_PrefabInstance: {fileID: 856927026}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &856927026 --- !u!1001 &856927026
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -986,6 +1001,22 @@ PrefabInstance:
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Range
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Lightmapping
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Shadows.m_Type
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -8679921383154817045, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 4 value: 4
@ -1098,6 +1129,22 @@ PrefabInstance:
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0.005 value: 0.005
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Range
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity
value: 1
objectReference: {fileID: 0}
- target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Lightmapping
value: 1
objectReference: {fileID: 0}
- target: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Shadows.m_Type
value: 0
objectReference: {fileID: 0}
- target: {fileID: -6778244770985483134, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -6778244770985483134, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
@ -1110,6 +1157,22 @@ PrefabInstance:
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Range
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity
value: 1
objectReference: {fileID: 0}
- target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Lightmapping
value: 1
objectReference: {fileID: 0}
- target: {fileID: -5428391844021183974, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Shadows.m_Type
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4857014484862980740, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -4857014484862980740, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
@ -1154,6 +1217,22 @@ PrefabInstance:
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Range
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity
value: 1
objectReference: {fileID: 0}
- target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Lightmapping
value: 1
objectReference: {fileID: 0}
- target: {fileID: -3152379998560609391, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Shadows.m_Type
value: 0
objectReference: {fileID: 0}
- target: {fileID: -2362259126034191535, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: -2362259126034191535, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
@ -1266,21 +1345,37 @@ PrefabInstance:
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0.005 value: 0.005
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Range
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity
value: 1
objectReference: {fileID: 0}
- target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Lightmapping
value: 1
objectReference: {fileID: 0}
- target: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Shadows.m_Type
value: 0
objectReference: {fileID: 0}
- target: {fileID: 557896573987745057, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 557896573987745057, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 795547410136657018, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 795547410136657018, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: -0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 795547410136657018, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 795547410136657018, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: 1.398 value: 1.404
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 795547410136657018, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 795547410136657018, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0.049 value: 0.067
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 919132149155446097, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Name propertyPath: m_Name
@ -1300,15 +1395,15 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1018638153358675470, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 1018638153358675470, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: -0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1018638153358675470, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 1018638153358675470, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: 1.167 value: 1.172
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1018638153358675470, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 1018638153358675470, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0.005 value: 0.018
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1121748732791834861, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 1121748732791834861, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
@ -1374,6 +1469,22 @@ PrefabInstance:
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0.005 value: 0.005
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Range
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Lightmapping
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3513320045853961206, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Shadows.m_Type
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3668888808494289767, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 3668888808494289767, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
@ -1422,10 +1533,42 @@ PrefabInstance:
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Range
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Lightmapping
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Shadows.m_Type
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7674321364131768348, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 7674321364131768348, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Range
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Intensity
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Lightmapping
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Shadows.m_Type
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8015441395889792915, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} - target: {fileID: 8015441395889792915, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
@ -3026,6 +3169,11 @@ MonoBehaviour:
Hand: 3 Hand: 3
duration: 0.07 duration: 0.07
amplitude: 1 amplitude: 1
--- !u!108 &1066863419 stripped
Light:
m_CorrespondingSourceObject: {fileID: -6930015188872202325, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
m_PrefabInstance: {fileID: 856927026}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1146353685 stripped --- !u!1 &1146353685 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: -7257406874482555907, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} m_CorrespondingSourceObject: {fileID: -7257406874482555907, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
@ -3218,6 +3366,11 @@ MonoBehaviour:
Hand: 2 Hand: 2
duration: 0.07 duration: 0.07
amplitude: 1 amplitude: 1
--- !u!108 &1270549371 stripped
Light:
m_CorrespondingSourceObject: {fileID: 7893704435040825264, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
m_PrefabInstance: {fileID: 856927026}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1278537032 stripped --- !u!1 &1278537032 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: -1936309250871818275, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} m_CorrespondingSourceObject: {fileID: -1936309250871818275, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
@ -3250,6 +3403,11 @@ MeshCollider:
m_Convex: 0 m_Convex: 0
m_CookingOptions: 30 m_CookingOptions: 30
m_Mesh: {fileID: -7308388866825325080, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} m_Mesh: {fileID: -7308388866825325080, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
--- !u!108 &1320268950 stripped
Light:
m_CorrespondingSourceObject: {fileID: -8699732548318090483, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
m_PrefabInstance: {fileID: 856927026}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1353751955 stripped --- !u!1 &1353751955 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: -4131411146230944194, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} m_CorrespondingSourceObject: {fileID: -4131411146230944194, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
@ -3410,6 +3568,11 @@ MonoBehaviour:
SmoothCameraObj: {fileID: 366364277} SmoothCameraObj: {fileID: 366364277}
SmoothCamera: {fileID: 366364279} SmoothCamera: {fileID: 366364279}
XROriginObj: {fileID: 1647048262} XROriginObj: {fileID: 1647048262}
ButtonObjs:
- {fileID: 856927138}
- {fileID: 856927137}
- {fileID: 856927133}
- {fileID: 856927132}
--- !u!4 &1419342723 --- !u!4 &1419342723
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3456,6 +3619,11 @@ MeshCollider:
m_Convex: 0 m_Convex: 0
m_CookingOptions: 30 m_CookingOptions: 30
m_Mesh: {fileID: -1704111116762882902, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} m_Mesh: {fileID: -1704111116762882902, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
--- !u!108 &1595987546 stripped
Light:
m_CorrespondingSourceObject: {fileID: -159454732624697724, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
m_PrefabInstance: {fileID: 856927026}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1647048262 --- !u!1 &1647048262
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3579,6 +3747,58 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ba164c8c2f2472547a03f77a0ad5aeed, type: 3} m_Script: {fileID: 11500000, guid: ba164c8c2f2472547a03f77a0ad5aeed, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!1 &1700545200
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1700545202}
- component: {fileID: 1700545201}
m_Layer: 0
m_Name: LedSerial
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1700545201
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1700545200}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5a6d5f12b098a574494724b6e4d36592, type: 3}
m_Name:
m_EditorClassIdentifier:
Lights:
- {fileID: 1320268950}
- {fileID: 1270549371}
- {fileID: 1066863419}
- {fileID: 129506686}
- {fileID: 1595987546}
- {fileID: 101046485}
- {fileID: 1956717701}
- {fileID: 852770257}
--- !u!4 &1700545202
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1700545200}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1900118868 --- !u!1 &1900118868
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3622,6 +3842,11 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &1956717701 stripped
Light:
m_CorrespondingSourceObject: {fileID: 6449048586731311642, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}
m_PrefabInstance: {fileID: 856927026}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2000481166 stripped --- !u!1 &2000481166 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: -2986973587981965295, guid: ea6463ca199d52046962b69f2ab654ef, type: 3} m_CorrespondingSourceObject: {fileID: -2986973587981965295, guid: ea6463ca199d52046962b69f2ab654ef, type: 3}

103
Assets/Scripts/LedSerial.cs Normal file
View File

@ -0,0 +1,103 @@
using System.Collections;
using UnityEngine;
using System.IO.Ports;
using System;
public class LedSerial : MonoBehaviour
{
static SerialPort p1Serial = new SerialPort ("COM51", 115200);
// Start is called before the first frame update
byte[] dataPacket = new byte[13];
byte[] incomPacket = new byte[13];
float timer = 0;
byte recivData;
int packLeng = 0;
public Light[] Lights;
Color32 PrevFadeColor;
bool headState = false;
void Start()
{
p1Serial.Open();
Debug.Log("LED Serial Started");
}
void Update()
{
//ReadPack();
ReadData();
//UpdatePacks();
}
private void ReadPack()
{
ReadData();
//StartCoroutine(ReadData());
Debug.Log("RX: "+dataPacket[0]+"-"+
dataPacket[1]+"-"+
dataPacket[2]+"-"+
dataPacket[3]+"-"+
dataPacket[4]+"-"+
dataPacket[5]+"-"+
dataPacket[6]+"-"+
dataPacket[7]+"-"+
dataPacket[8]+"-"+
dataPacket[9]+"-"+
dataPacket[10]);
}
private void ReadData()
{
timer = 0f;
if (p1Serial.BytesToRead >= 3)
{
if (!headState)
recivData = Convert.ToByte(p1Serial.ReadByte());
headState = false;
if (recivData == 224)
{
do
{
incomPacket[packLeng++] = recivData;
recivData = Convert.ToByte(p1Serial.ReadByte());
}
while (recivData != 224 & p1Serial.BytesToRead >= 1);
headState = true;
dataPacket = incomPacket;
packLeng = 0;
UpdateLED();
}
}
}
private void UpdateLED()
{
switch (dataPacket[4])
{
case 49:
if (dataPacket[5] > 7)
dataPacket[5] = 7;
Lights[dataPacket[5]].color = new Color32(dataPacket[6], dataPacket[7], dataPacket[8], 255);
break;
case 50:
if (dataPacket[6] > 8)
dataPacket[6] = 8;
for (int i = dataPacket[5]; i < dataPacket[6]; i++)
{
Lights[i].color = new Color32(dataPacket[8], dataPacket[9], dataPacket[10], 255);
}
PrevFadeColor = new Color32(dataPacket[8], dataPacket[9], dataPacket[10], 255);
break;
case 51:
if (dataPacket[6] > 8)
dataPacket[6] = 8;
for (int time = 0; time < dataPacket[11]; time++)
{
for (int i = dataPacket[5]; i < dataPacket[6]; i++)
{
Lights[i].color = Color.Lerp(PrevFadeColor, new Color32(dataPacket[8], dataPacket[9], dataPacket[10], 255), time / 255);
}
}
PrevFadeColor = new Color32(dataPacket[8], dataPacket[9], dataPacket[10], 255);
break;
}
}
}

View File

@ -17,7 +17,7 @@ public class SettingsManager : MonoBehaviour
public GameObject SmoothCameraObj; public GameObject SmoothCameraObj;
public Camera SmoothCamera; public Camera SmoothCamera;
public GameObject XROriginObj; public GameObject XROriginObj;
public GameObject Button1Obj; public GameObject[] ButtonObjs;
void Start() void Start()
{ {
FirstStart(); FirstStart();
@ -59,8 +59,14 @@ public class SettingsManager : MonoBehaviour
RHandScp.amplitude = Setting.HapticAmplitude; RHandScp.amplitude = Setting.HapticAmplitude;
XROriginScp.CameraYOffset = Setting.PlayerHigh/100; XROriginScp.CameraYOffset = Setting.PlayerHigh/100;
Time.fixedDeltaTime = 1/Setting.TouchRefreshRate; Time.fixedDeltaTime = 1/Setting.TouchRefreshRate;
ButtonToKey Button1Scp = Button1Obj.GetComponent<ButtonToKey>(); ButtonToKey Button1Scp = ButtonObjs[0].GetComponent<ButtonToKey>();
Button1Scp.keyToPress = (VirtualKeyCode)Enum.Parse(typeof(VirtualKeyCode), Setting.Button1); Button1Scp.keyToPress = (VirtualKeyCode)Enum.Parse(typeof(VirtualKeyCode), Setting.Button1);
ButtonToKey Button2Scp = ButtonObjs[1].GetComponent<ButtonToKey>();
Button1Scp.keyToPress = (VirtualKeyCode)Enum.Parse(typeof(VirtualKeyCode), Setting.Button2);
ButtonToKey Button3Scp = ButtonObjs[2].GetComponent<ButtonToKey>();
Button1Scp.keyToPress = (VirtualKeyCode)Enum.Parse(typeof(VirtualKeyCode), Setting.Button3);
ButtonToKey Button4Scp = ButtonObjs[3].GetComponent<ButtonToKey>();
Button1Scp.keyToPress = (VirtualKeyCode)Enum.Parse(typeof(VirtualKeyCode), Setting.Button4);
} }
void FirstStart() void FirstStart()
@ -82,7 +88,10 @@ public class SettingsManager : MonoBehaviour
CameraFOV = 85f, CameraFOV = 85f,
HapticDuration = 0.15f, HapticDuration = 0.15f,
HapticAmplitude = 1, HapticAmplitude = 1,
Button1 = "SCROLL" Button1 = "SCROLL",
Button2 = "PAUSE",
Button3 = "VK_1",
Button4 = "VK_2"
}; };
JsonStr = JsonConvert.SerializeObject(Setting, Formatting.Indented); JsonStr = JsonConvert.SerializeObject(Setting, Formatting.Indented);
Debug.Log(JsonStr); Debug.Log(JsonStr);
@ -110,8 +119,8 @@ public class Settings
public float HapticDuration { get; set; } public float HapticDuration { get; set; }
public float HapticAmplitude { get; set; } public float HapticAmplitude { get; set; }
public string Button1 { get; set; } public string Button1 { get; set; }
//public string Button2 { get; set; } public string Button2 { get; set; }
//public string Button3 { get; set; } public string Button3 { get; set; }
//public string Button4 { get; set; } public string Button4 { get; set; }
} }

View File

@ -4,7 +4,7 @@
QualitySettings: QualitySettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 5 serializedVersion: 5
m_CurrentQuality: 4 m_CurrentQuality: 2
m_QualitySettings: m_QualitySettings:
- serializedVersion: 2 - serializedVersion: 2
name: Very Low name: Very Low
@ -80,7 +80,7 @@ QualitySettings:
excludedTargetPlatforms: [] excludedTargetPlatforms: []
- serializedVersion: 2 - serializedVersion: 2
name: Medium name: Medium
pixelLightCount: 2 pixelLightCount: 12
shadows: 1 shadows: 1
shadowResolution: 0 shadowResolution: 0
shadowProjection: 0 shadowProjection: 0
@ -116,7 +116,7 @@ QualitySettings:
excludedTargetPlatforms: [] excludedTargetPlatforms: []
- serializedVersion: 2 - serializedVersion: 2
name: High name: High
pixelLightCount: 2 pixelLightCount: 12
shadows: 2 shadows: 2
shadowResolution: 1 shadowResolution: 1
shadowProjection: 1 shadowProjection: 1
@ -152,7 +152,7 @@ QualitySettings:
excludedTargetPlatforms: [] excludedTargetPlatforms: []
- serializedVersion: 2 - serializedVersion: 2
name: Very High name: Very High
pixelLightCount: 3 pixelLightCount: 12
shadows: 0 shadows: 0
shadowResolution: 0 shadowResolution: 0
shadowProjection: 1 shadowProjection: 1
@ -188,7 +188,7 @@ QualitySettings:
excludedTargetPlatforms: [] excludedTargetPlatforms: []
- serializedVersion: 2 - serializedVersion: 2
name: Ultra name: Ultra
pixelLightCount: 4 pixelLightCount: 12
shadows: 2 shadows: 2
shadowResolution: 3 shadowResolution: 3
shadowProjection: 1 shadowProjection: 1
@ -230,7 +230,7 @@ QualitySettings:
PS4: 5 PS4: 5
PSP2: 2 PSP2: 2
Stadia: 5 Stadia: 5
Standalone: 4 Standalone: 2
WebGL: 3 WebGL: 3
Windows Store Apps: 5 Windows Store Apps: 5
XboxOne: 5 XboxOne: 5