1
0
mirror of synced 2025-02-17 19:19:18 +01:00

Merge pull request #36 from xiaopeng12138/xpeng-dev

LED and leapmotion update
This commit is contained in:
xpeng 2022-07-30 01:04:55 +02:00 committed by GitHub
commit 8db9b3a003
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
72 changed files with 6513 additions and 252 deletions

2
.gitignore vendored
View File

@ -7,6 +7,7 @@
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Bb]uildCPP/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/
@ -79,4 +80,3 @@ uWindowCapture.log
# Game configuration file
config.json

55
.vscode/settings.json vendored
View File

@ -1,55 +0,0 @@
{
"files.exclude":
{
"**/.DS_Store":true,
"**/.git":true,
"**/.gitmodules":true,
"**/*.booproj":true,
"**/*.pidb":true,
"**/*.suo":true,
"**/*.user":true,
"**/*.userprefs":true,
"**/*.unityproj":true,
"**/*.dll":true,
"**/*.exe":true,
"**/*.pdf":true,
"**/*.mid":true,
"**/*.midi":true,
"**/*.wav":true,
"**/*.gif":true,
"**/*.ico":true,
"**/*.jpg":true,
"**/*.jpeg":true,
"**/*.png":true,
"**/*.psd":true,
"**/*.tga":true,
"**/*.tif":true,
"**/*.tiff":true,
"**/*.3ds":true,
"**/*.3DS":true,
"**/*.fbx":true,
"**/*.FBX":true,
"**/*.lxo":true,
"**/*.LXO":true,
"**/*.ma":true,
"**/*.MA":true,
"**/*.obj":true,
"**/*.OBJ":true,
"**/*.asset":true,
"**/*.cubemap":true,
"**/*.flare":true,
"**/*.mat":true,
"**/*.meta":true,
"**/*.prefab":true,
"**/*.unity":true,
"build/":true,
"Build/":true,
"Library/":true,
"library/":true,
"obj/":true,
"Obj/":true,
"ProjectSettings/":true,
"temp/":true,
"Temp/":true
}
}

View File

@ -1,6 +0,0 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}

View File

@ -15,7 +15,7 @@ LightingSettings:
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_UsingShadowmask: 0
m_BakeBackend: 1
m_LightmapMaxSize: 1024
m_BakeResolution: 40
@ -26,7 +26,7 @@ LightingSettings:
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_MixedBakeMode: 1
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}

BIN
Assets/GenericHand.fbx Normal file

Binary file not shown.

384
Assets/GenericHand.fbx.meta Normal file
View File

@ -0,0 +1,384 @@
fileFormatVersion: 2
guid: a472990c8cae70941a70f37700a7251e
ModelImporter:
serializedVersion: 21202
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: phong1
second: {fileID: 2100000, guid: 4c1d8de22955e4a4c8dda3f54365517d, type: 2}
materials:
materialImportMode: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors: "Invalid Avatar Rig Configuration. Missing or invalid transform:\n\tRequired
human bone 'LeftLowerLeg' not found\n"
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 3
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 0
fileIdsGeneration: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 0
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 1
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human:
- boneName: L_Wrist
humanName: LeftHand
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_thumb_meta
humanName: Left Thumb Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_thumb_a
humanName: Left Thumb Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_thumb_b
humanName: Left Thumb Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_index_meta
humanName: Left Index Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_index_a
humanName: Left Index Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_index_b
humanName: Left Index Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_middle_meta
humanName: Left Middle Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_middle_a
humanName: Left Middle Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_middle_b
humanName: Left Middle Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_ring_meta
humanName: Left Ring Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_ring_a
humanName: Left Ring Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_ring_b
humanName: Left Ring Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_pinky_meta
humanName: Left Little Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_pinky_a
humanName: Left Little Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: L_pinky_b
humanName: Left Little Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
skeleton:
- name: GenericHand(Clone)
parentName:
position: {x: -0, y: 0, z: 0}
rotation: {x: 0, y: -0, z: -0, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: baseMeshHand_Left_GRP
parentName: GenericHand(Clone)
position: {x: -0, y: 0, z: 0}
rotation: {x: 0, y: -0, z: -0, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: GenericHand
parentName: baseMeshHand_Left_GRP
position: {x: -0, y: 0, z: 0}
rotation: {x: 0, y: -0, z: -0, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: L_Wrist
parentName: baseMeshHand_Left_GRP
position: {x: 0.12846193, y: 0.040483464, z: 0.011796616}
rotation: {x: -0.5252183, y: 0.5351824, z: -0.47444028, w: 0.46112037}
scale: {x: 1, y: 1, z: 1}
- name: L_Palm
parentName: L_Wrist
position: {x: -0, y: 0, z: 0}
rotation: {x: 2.0816682e-16, y: 4.7704896e-18, z: -2.6454533e-17, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: L_index_meta
parentName: L_Palm
position: {x: -0.026815364, y: -0.0038297235, z: -0.01722223}
rotation: {x: 0.08937924, y: -0.059807032, z: -0.025502445, w: 0.9938733}
scale: {x: 1, y: 1, z: 1}
- name: L_index_a
parentName: L_index_meta
position: {x: -0.06101329, y: -1.9984014e-17, z: 1.0658141e-16}
rotation: {x: -0.034828003, y: 0.018826038, z: -0.0028283815, w: 0.999212}
scale: {x: 1, y: 1, z: 1}
- name: L_index_b
parentName: L_index_a
position: {x: -0.027736768, y: -2.1316282e-16, z: -8.8817837e-17}
rotation: {x: 1.495196e-16, y: 1.1640173e-16, z: -0.08736947, w: 0.996176}
scale: {x: 1, y: 1, z: 1}
- name: L_index_c
parentName: L_index_b
position: {x: -0.020685617, y: 1.7763568e-17, z: 1.7763568e-17}
rotation: {x: 2.3085585e-17, y: 1.6176834e-17, z: -0.03227771, w: 0.99947894}
scale: {x: 1, y: 1, z: 1}
- name: L_index_end
parentName: L_index_c
position: {x: -0.023225406, y: -8.881784e-18, z: 0}
rotation: {x: 1.7347235e-18, y: -1.3010426e-18, z: 2.7755576e-17, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: L_middle_meta
parentName: L_Palm
position: {x: -0.03152068, y: -0.00965535, z: -0.0024167688}
rotation: {x: 0.073170304, y: -0.02300239, z: -0.052931614, w: 0.99564815}
scale: {x: 1, y: 1, z: 1}
- name: L_middle_a
parentName: L_middle_meta
position: {x: -0.059184518, y: -4.440892e-18, z: -1.7763568e-17}
rotation: {x: -0.025934359, y: 0.019007757, z: -0.01213545, w: 0.99940926}
scale: {x: 1, y: 1, z: 1}
- name: L_middle_b
parentName: L_middle_a
position: {x: -0.029554103, y: 0, z: 1.0658141e-16}
rotation: {x: 6.819331e-17, y: 1.7492539e-16, z: -0.052136343, w: 0.99864}
scale: {x: 1, y: 1, z: 1}
- name: L_middle_c
parentName: L_middle_b
position: {x: -0.023103267, y: -4.4408918e-17, z: -8.8817837e-17}
rotation: {x: 5.4630465e-17, y: 1.5586695e-16, z: -0.038606502, w: 0.9992545}
scale: {x: 1, y: 1, z: 1}
- name: L_middle_end
parentName: L_middle_c
position: {x: -0.025080224, y: 0, z: 0}
rotation: {x: -1.1275703e-16, y: -1.7347235e-18, z: 2.7755576e-17, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: L_pinky_meta
parentName: L_Palm
position: {x: -0.024579609, y: -0.0056739524, z: 0.023602597}
rotation: {x: 0.049113765, y: 0.082898416, z: -0.06561921, w: 0.9931817}
scale: {x: 1, y: 1, z: 1}
- name: L_pinky_a
parentName: L_pinky_meta
position: {x: -0.05157233, y: -1.7763568e-17, z: -1.4210854e-16}
rotation: {x: -0.0010698298, y: -0.026155079, z: -0.04085515, w: 0.99882215}
scale: {x: 1, y: 1, z: 1}
- name: L_pinky_b
parentName: L_pinky_a
position: {x: -0.0227088, y: -2.2204459e-17, z: 1.5987211e-16}
rotation: {x: -1.5272543e-16, y: -4.5839165e-18, z: -0.012582445, w: 0.99992085}
scale: {x: 1, y: 1, z: 1}
- name: L_pinky_c
parentName: L_pinky_b
position: {x: -0.016491236, y: -4.440892e-18, z: -8.8817837e-17}
rotation: {x: -2.0817088e-16, y: -1.735298e-18, z: 0.018750928, w: 0.99982417}
scale: {x: 1, y: 1, z: 1}
- name: L_pinky_end
parentName: L_pinky_c
position: {x: -0.015675519, y: -8.881784e-18, z: 3.5527136e-17}
rotation: {x: 1.7347235e-18, y: 1.0408341e-17, z: -1.3877788e-17, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: L_ring_meta
parentName: L_Palm
position: {x: -0.028662479, y: -0.007954737, z: 0.010319745}
rotation: {x: 0.030895384, y: 0.032731224, z: -0.04615708, w: 0.9979197}
scale: {x: 1, y: 1, z: 1}
- name: L_ring_a
parentName: L_ring_meta
position: {x: -0.056782074, y: 4.4408918e-17, z: 7.105427e-17}
rotation: {x: -0.00026740084, y: -0.004355108, z: -0.061283372, w: 0.9981109}
scale: {x: 1, y: 1, z: 1}
- name: L_ring_b
parentName: L_ring_a
position: {x: -0.02793383, y: -8.881784e-18, z: -5.3290704e-17}
rotation: {x: 3.1335338e-16, y: 1.3399357e-17, z: -0.051407326, w: 0.9986778}
scale: {x: 1, y: 1, z: 1}
- name: L_ring_c
parentName: L_ring_b
position: {x: -0.022412032, y: 8.881784e-18, z: 1.7763568e-17}
rotation: {x: 1.1501306e-16, y: 1.1765776e-16, z: -0.033373818, w: 0.99944293}
scale: {x: 1, y: 1, z: 1}
- name: L_ring_end
parentName: L_ring_c
position: {x: -0.021209665, y: 0, z: 0}
rotation: {x: 3.469447e-18, y: -5.2041704e-18, z: 5.551115e-17, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: L_thumb_meta
parentName: L_Palm
position: {x: -0.022049556, y: 0.0055027115, z: -0.02042907}
rotation: {x: 0.59991735, y: -0.46595657, z: 0.028238742, w: 0.6497586}
scale: {x: 1, y: 1, z: 1}
- name: L_thumb_a
parentName: L_thumb_meta
position: {x: -0.039247386, y: 1.7763568e-17, z: -4.440892e-18}
rotation: {x: 0.0030103829, y: 0.040769648, z: -0.07357679, w: 0.9964513}
scale: {x: 1, y: 1, z: 1}
- name: L_thumb_b
parentName: L_thumb_a
position: {x: -0.027161183, y: 0, z: 0}
rotation: {x: -0.0035581873, y: -0.017184764, z: -0.092769355, w: 0.995533}
scale: {x: 1, y: 1, z: 1}
- name: L_thumb_end
parentName: L_thumb_b
position: {x: -0.023094935, y: 0, z: 8.881784e-18}
rotation: {x: -6.938894e-17, y: -2.7755576e-17, z: -1.92593e-33, w: 1}
scale: {x: 1, y: 1, z: 1}
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 3
humanoidOversampling: 1
avatarSetup: 1
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-413709739032973700
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 07 - Default
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 341c0012e16942147abf1e3af3410a93
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -8,15 +8,15 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Material.001
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Shader: {fileID: 4800000, guid: 6661b5a6c9b5f6e45ae07f0fa22876e2, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_InvalidKeywords:
- _FLIPBOOKBLENDING_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
@ -81,15 +81,28 @@ Material:
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BlendOp: 0
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _ColorMode: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0.1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _FlipX: 0
- _FlipY: 0
- _FlipbookBlending: 0
- _FlipbookMode: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
@ -101,6 +114,9 @@ Material:
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1
- _SoftParticlesNearFadeDistance: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
@ -109,8 +125,11 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.9063317, g: 0.9063317, b: 0.9063317, a: 1}
- _Color: {r: 0.9063317, g: 0.9063317, b: 0.9063317, a: 1}
- _BaseColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
- _CameraFadeParams: {r: 0, g: 0, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &155017172321468035

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d458ce140681dc54789cfca07db3fa54
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,404 @@
fileFormatVersion: 2
guid: e66f80af25df0b042b3e6ecf435c7c80
ModelImporter:
serializedVersion: 21202
internalIDToNameTable:
- first:
74: 1827226128182048838
second: Take 001
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: 07 - Default
second: {fileID: 2100000, guid: 341c0012e16942147abf1e3af3410a93, type: 2}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 1
motionNodeName:
rigImportErrors: "Invalid Avatar Rig Configuration. Missing or invalid transform:\n\tRequired
human bone 'RightUpperLeg' not found\n"
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 3
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human:
- boneName: Hand(Clone)
humanName: RightHand
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone13
humanName: Left Thumb Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone14
humanName: Left Thumb Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone15
humanName: Left Thumb Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone09
humanName: Left Index Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone10
humanName: Left Index Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone11
humanName: Left Index Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone05
humanName: Left Middle Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone06
humanName: Left Middle Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone07
humanName: Left Middle Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone01
humanName: Left Ring Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone02
humanName: Left Ring Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone03
humanName: Left Ring Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone17
humanName: Left Little Proximal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone18
humanName: Left Little Intermediate
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
- boneName: Bone19
humanName: Left Little Distal
limit:
min: {x: 0, y: 0, z: 0}
max: {x: 0, y: 0, z: 0}
value: {x: 0, y: 0, z: 0}
length: 0
modified: 0
skeleton:
- name: Hand(Clone)
parentName:
position: {x: 0, y: 0, z: 0}
rotation: {x: 0, y: 0, z: 0, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: Bone01
parentName: Hand(Clone)
position: {x: -0.011934155, y: 0.008938804, z: -0.02400536}
rotation: {x: -0.5006422, y: -0.43556246, z: -0.49102378, w: 0.5643921}
scale: {x: 1, y: 1, z: 0.99999994}
- name: Bone02
parentName: Bone01
position: {x: -0.036920343, y: -0.000000008583069, z: 0.0000000014305115}
rotation: {x: -0.017791994, y: -0.122187585, z: 0.0057378532, w: 0.99233097}
scale: {x: 0.99999994, y: 1.0000001, z: 1}
- name: Bone03
parentName: Bone02
position: {x: -0.02692111, y: -0.0000000038146974, z: 0.0000000038146974}
rotation: {x: -0.004953547, y: -0.05780036, z: -0.06472319, w: 0.9962156}
scale: {x: 1, y: 1.0000002, z: 1}
- name: Bone04
parentName: Bone03
position: {x: -0.026085092, y: 0, z: 0.0000000038146974}
rotation: {x: 0, y: 0, z: 4.656613e-10, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: Bone05
parentName: Hand(Clone)
position: {x: 0.01113187, y: 0.010199127, z: -0.025673924}
rotation: {x: 0.5160792, y: 0.51321524, z: 0.48356223, w: -0.486251}
scale: {x: 0.99999994, y: 1, z: 1}
- name: Bone06
parentName: Bone05
position: {x: -0.04839589, y: -0.0000001115799, z: 9.536744e-10}
rotation: {x: 0.00058908423, y: -0.080818936, z: -0.01273665, w: 0.99664724}
scale: {x: 1, y: 1, z: 1.0000001}
- name: Bone07
parentName: Bone06
position: {x: -0.026891587, y: 9.536744e-10, z: -0.0000000038146974}
rotation: {x: 0.0021989814, y: -0.07427211, z: -0.009570426, w: 0.99718964}
scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001}
- name: Bone08
parentName: Bone07
position: {x: -0.027444987, y: 9.536744e-10, z: 0}
rotation: {x: -9.313225e-10, y: 0.000000014901163, z: -0.000000002793968, w: 1}
scale: {x: 0.99999994, y: 1, z: 0.99999994}
- name: Bone09
parentName: Hand(Clone)
position: {x: 0.03290968, y: 0.007145492, z: -0.02352303}
rotation: {x: 0.49763906, y: 0.56051576, z: 0.5031633, w: -0.4301211}
scale: {x: 1, y: 0.99999994, z: 0.99999994}
- name: Bone10
parentName: Bone09
position: {x: -0.041521553, y: -0.000000009536744, z: -0.0000000019073487}
rotation: {x: 0.010370612, y: -0.093955845, z: -0.0015428128, w: 0.9955212}
scale: {x: 1.0000001, y: 1.0000001, z: 0.99999994}
- name: Bone11
parentName: Bone10
position: {x: -0.024980653, y: 0.000000036239626, z: 0}
rotation: {x: 0.011415185, y: -0.1598352, z: -0.016433036, w: 0.9869409}
scale: {x: 1, y: 1, z: 1}
- name: Bone12
parentName: Bone11
position: {x: -0.026477464, y: 0.000000005722046, z: 0.0000000038146974}
rotation: {x: 0, y: 0, z: -0.000000078231096, w: 1}
scale: {x: 1, y: 1, z: 1}
- name: Bone13
parentName: Hand(Clone)
position: {x: 0.04877115, y: 0.0023237907, z: -0.016432866}
rotation: {x: 0.4662776, y: 0.6331536, z: 0.53158695, w: -0.3148288}
scale: {x: 1, y: 1, z: 1}
- name: Bone14
parentName: Bone13
position: {x: -0.034001198, y: -0.000000007629395, z: -0.0000000038146974}
rotation: {x: 0.004907234, y: -0.116644524, z: 0.0417474, w: 0.9922838}
scale: {x: 1, y: 1.0000001, z: 1}
- name: Bone15
parentName: Bone14
position: {x: -0.020578183, y: -0.000000026702882, z: 0}
rotation: {x: -0.0016650776, y: -0.09773289, z: -0.016953228, w: 0.9950669}
scale: {x: 1.0000002, y: 1.0000002, z: 1}
- name: Bone16
parentName: Bone15
position: {x: -0.02423475, y: 0.000000022888184, z: -0.0000000038146974}
rotation: {x: -0.0000000025611369, y: -0.000000014901163, z: 0.00000001420267,
w: 1}
scale: {x: 0.99999994, y: 1, z: 1}
- name: Bone17
parentName: Hand(Clone)
position: {x: -0.032245573, y: 0.0038356315, z: 0.027263654}
rotation: {x: -0.24009125, y: -0.52834016, z: 0.12023596, w: 0.805454}
scale: {x: 0.99999994, y: 1, z: 1}
- name: Bone18
parentName: Bone17
position: {x: -0.0368655, y: -9.536744e-10, z: 0}
rotation: {x: -0.0097121885, y: -0.04900509, z: -0.019926088, w: 0.99855256}
scale: {x: 0.99999994, y: 1, z: 1}
- name: Bone19
parentName: Bone18
position: {x: -0.03100292, y: -0.000000016212464, z: 0}
rotation: {x: -0.000000007450581, y: 0.0000000037252903, z: 0.000000029802326,
w: 1}
scale: {x: 0.99999994, y: 1, z: 1.0000001}
- name: Camera01
parentName: Hand(Clone)
position: {x: -0.13171718, y: -0.13857044, z: -0.3494977}
rotation: {x: -0.1854637, y: 0.21360154, z: 0.041340757, w: 0.95826334}
scale: {x: 1, y: 1, z: 1}
- name: Camera01.Target
parentName: Hand(Clone)
position: {x: 0.023536172, y: 0.008435673, z: -0.01855098}
rotation: {x: 0.059890084, y: -0.6441295, z: 0.050685003, w: 0.76088196}
scale: {x: 0.9999898, y: 0.9999971, z: 0.99998873}
- name: Camera02
parentName: Hand(Clone)
position: {x: -0.089358725, y: 0.14932239, z: -0.20230472}
rotation: {x: 0.33407947, y: 0.25952673, z: -0.0962307, w: 0.9009864}
scale: {x: 1, y: 1, z: 1}
- name: Camera02.Target
parentName: Hand(Clone)
position: {x: -0.0018954399, y: 0.007956452, z: -0.06308035}
rotation: {x: 0.050252214, y: 0.9269789, z: 0.34658352, w: -0.1344054}
scale: {x: 0.9999997, y: 0.99999994, z: 1.0000002}
- name: Camera03
parentName: Hand(Clone)
position: {x: -0.29166073, y: 0.020929007, z: -0.01883878}
rotation: {x: 0.025262382, y: 0.7164792, z: -0.025980823, w: 0.6966666}
scale: {x: 1, y: 1, z: 1}
- name: Camera03.Target
parentName: Hand(Clone)
position: {x: -0.13646993, y: 0.009654779, z: -0.023191262}
rotation: {x: -0.024956526, y: -0.7300452, z: -0.026698183, w: 0.68242097}
scale: {x: 1.0000004, y: 0.99999976, z: 1}
- name: Circle01
parentName: Hand(Clone)
position: {x: 0.024914412, y: 0.000507659, z: 0.08428351}
rotation: {x: -0.0000004789352, y: 0.12627111, z: 0.00000006096364, w: 0.9919958}
scale: {x: -0.7303174, y: -0.3969333, z: -0.48805025}
- name: Direct01
parentName: Hand(Clone)
position: {x: -0.014849229, y: 0.33360296, z: 0.16930427}
rotation: {x: 0.84691375, y: -0.025127307, z: 0.040181443, w: 0.52961415}
scale: {x: 1, y: 1, z: 0.99999994}
- name: Direct01.Target
parentName: Hand(Clone)
position: {x: -5.7551286e-10, y: 0.011467667, z: 0.0131662}
rotation: {x: 0.000000015454312, y: -0.7071068, z: 0.000000015454312, w: 0.7071068}
scale: {x: 1, y: 1, z: 1}
- name: Omni01
parentName: Hand(Clone)
position: {x: -0.12890382, y: -0.07555395, z: 0.054828037}
rotation: {x: 0.7071068, y: 0.000000029802326, z: 0.70710677, w: 0}
scale: {x: 1, y: 1, z: 1}
- name: Omni02
parentName: Hand(Clone)
position: {x: -0.15189713, y: -0.074229956, z: -0.33149582}
rotation: {x: 0.7071068, y: 0.000000029802326, z: 0.70710677, w: 0}
scale: {x: 1, y: 1, z: 1}
- name: Sky01
parentName: Hand(Clone)
position: {x: 0.2529143, y: 0, z: 0.1527795}
rotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
scale: {x: 1, y: 1, z: 1}
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 1
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 3
humanoidOversampling: 1
avatarSetup: 1
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

After

Width:  |  Height:  |  Size: 242 KiB

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ec53dcc57d04ff941b2974ead0217a06
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,3 @@
{
"name": "Camera"
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2dcfcfc00d4ac7749bb60698b85f1dc2
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,19 @@
using UnityEngine;
[RequireComponent(typeof(Camera))]
public class CameraSmooth : MonoBehaviour {
public Transform target;
public float smoothSpeed = 0.125f;
public Vector3 PositionOffset;
public int FPS = 60;
private void Start()
{
QualitySettings.vSyncCount = 0;
Application.targetFrameRate = FPS;
}
void Update ()
{
transform.position = Vector3.Lerp(transform.position, target.position + PositionOffset, smoothSpeed);
transform.rotation = Quaternion.Lerp(transform.rotation, target.rotation, smoothSpeed);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e44f24d571d0baa46bacf3d93aca3592
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
{
"name": "Configuration",
"rootNamespace": "",
"references": [
"GUID:56dd35f9b6f21364494ed8365264cbf6"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 80de51a1f88203a4cb129a5922de311f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -27,6 +27,7 @@ public class SettingsManager : MonoBehaviour
{
FocusChecked=true;
UpdateAllConfigs();
Debug.Log("Configs Updated");
}
}
if (!Application.isFocused)
@ -38,7 +39,7 @@ public class SettingsManager : MonoBehaviour
UwcConfig.UpdateConfigs();
UpdatePhysicFPS();
UpdateHands();
Debug.Log("Configs Updated");
}
void UpdatePhysicFPS()

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f09d9fc74e7b7874cbb1324e30a08097
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,19 @@
{
"name": "ControlPanel",
"rootNamespace": "",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:2dcfcfc00d4ac7749bb60698b85f1dc2",
"GUID:80de51a1f88203a4cb129a5922de311f"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5436500ab54595849b4b0dda68b4f629
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -9,6 +9,7 @@ public class PanelThirdPersonButton : MonoBehaviour
private Renderer cr;
public GameObject tpCamera;
public GameObject fpsCamera;
public AudioSource audioSrc;
void Start()
@ -31,6 +32,7 @@ public class PanelThirdPersonButton : MonoBehaviour
isTP = state;
cr.material.color = state ? Color.green : Color.red;
tpCamera?.SetActive(state);
fpsCamera?.SetActive(!state);
JsonConfiguration.SetBoolean("ThirdPerson", state);
}

View File

@ -12,6 +12,8 @@ public class SkyboxSwitcher : MonoBehaviour
private string skyboxPath;
public List<Texture2D> textures = new List<Texture2D>();
public List<System.IntPtr> ptrs = new List<System.IntPtr>();
public static bool useSkybox = false;
public GameObject Room;
[SerializeField]
private List<Material> skyboxes;
@ -28,9 +30,13 @@ public class SkyboxSwitcher : MonoBehaviour
void Start()
{
if (JsonConfiguration.HasKey("useSkybox")) useSkybox = JsonConfiguration.GetBoolean("useSkybox");
else SaveSkyboxState();
Room.SetActive(!useSkybox);
if (JsonConfiguration.HasKey("Skybox")) currentSkyboxIndex = JsonConfiguration.GetInt("Skybox");
else SaveSkyboxIndex();
incrementBtn.ButtonPressed += IncrementEvent;
decrementBtn.ButtonPressed += DecrementEvent;
@ -133,4 +139,8 @@ public class SkyboxSwitcher : MonoBehaviour
{
JsonConfiguration.SetInt("Skybox", currentSkyboxIndex);
}
private void SaveSkyboxState()
{
JsonConfiguration.SetBoolean("useSkybox", useSkybox);
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eb29cb63023e4334091c0a3b9120db12
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,14 @@
{
"name": "Controller",
"rootNamespace": "",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cf7bd9a36ac2a084fa8157f5e52857ee
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,39 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LightManager : MonoBehaviour
{
public List<GameObject> Lights = new List<GameObject>();
public float FadeDuration = 0.5f;
private IEnumerator[] coroutines = new IEnumerator[240];
private void Start()
{
}
public void UpdateLight(int Area, bool State)
{
Area -= 1;
Material mat = Lights[Area].GetComponent<Renderer>().material;
if (State)
{
mat.SetColor("_EmissionColor", new Color(1f, 1f, 1f, 1f));
}
else
{
if (coroutines[Area] != null)
StopCoroutine(coroutines[Area]);
coroutines[Area] = FadeOut(Area, mat);
StartCoroutine(coroutines[Area]);
}
}
public IEnumerator FadeOut(int Area, Material mat)
{
for (float time = 0f; time < FadeDuration; time += Time.deltaTime)
{
float p = 1 - time / FadeDuration;
mat.SetColor("_EmissionColor", new Color(p, p, p, 1f));
yield return null;
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2aad60c7a05eeb444bd1923af833ecae
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
{
"name": "LightManager",
"rootNamespace": "",
"references": [
"GUID:80de51a1f88203a4cb129a5922de311f"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 476196b3fd6829e45b839eb138f356ed
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,104 @@
using System.Collections;
using System.Collections.Generic;
using System.IO.MemoryMappedFiles;
using System.Security.Principal;
using UnityEngine;
public class LightManager : MonoBehaviour
{
public List<GameObject> Lights = new List<GameObject>();
List<Material> Materials = new List<Material>();
public static bool useIPC = true;
static Texture2D RGBColor2D;
public static MemoryMappedFile sharedBuffer;
public static MemoryMappedViewAccessor sharedBufferAccessor;
private IEnumerator[] coroutines = new IEnumerator[240];
public float FadeDuration = 0.5f;
private void Start()
{
if (JsonConfiguration.HasKey("useIPC"))
useIPC = JsonConfiguration.GetBoolean("useIPC");
else
JsonConfiguration.SetBoolean("useIPC", useIPC);
for (int i = 0; i < Lights.Count; i++)
Materials.Add(Lights[i].GetComponent<Renderer>().material);
if (useIPC)
{
InitializeIPC("Local\\WACVR_SHARED_BUFFER", 2164);
RGBColor2D = new Texture2D(480, 1, TextureFormat.RGBA32, false);
//RGBColor2D.filterMode = FilterMode.Point; //for debugging
//GetComponent<Renderer>().material.mainTexture = RGBColor2D; //for debugging
}
}
private void Update()
{
if (useIPC)
UpdateLED();
}
private void InitializeIPC(string sharedMemoryName, int sharedMemorySize)
{
MemoryMappedFileSecurity CustomSecurity = new MemoryMappedFileSecurity();
SecurityIdentifier sid = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
var acct = sid.Translate(typeof(NTAccount)) as NTAccount;
CustomSecurity.AddAccessRule(new System.Security.AccessControl.AccessRule<MemoryMappedFileRights>(acct.ToString(), MemoryMappedFileRights.FullControl, System.Security.AccessControl.AccessControlType.Allow));
sharedBuffer = MemoryMappedFile.CreateOrOpen(sharedMemoryName, sharedMemorySize, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None, CustomSecurity, System.IO.HandleInheritability.Inheritable);
sharedBufferAccessor = sharedBuffer.CreateViewAccessor();
}
private void UpdateLED()
{
GetTextureFromBytes(GetBytesFromMemory());
int index = 0;
for (int i = 0; i < 30; i++)
{
for (int ii = 0; ii < 4; ii++)
{
Materials[119 - i - ii * 30].SetColor("_EmissionColor", RGBColor2D.GetPixel(index * 2, 0));
Materials[210 + i - ii * 30].SetColor("_EmissionColor", RGBColor2D.GetPixel((index + 120) * 2, 0));
index++;
}
}
}
void GetTextureFromBytes(byte[] bytes)
{
RGBColor2D.LoadRawTextureData(bytes);
RGBColor2D.Apply();
}
byte[] GetBytesFromMemory()
{
byte[] bytes = new byte[1920];
sharedBufferAccessor.ReadArray<byte>(244, bytes, 0, 1920);
return bytes;
}
public void UpdateLightFade(int Area, bool State)
{
if(useIPC)
return;
Area -= 1;
if (State)
{
Materials[Area].SetColor("_EmissionColor", new Color(1f, 1f, 1f, 1f));
}
else
{
if (coroutines[Area] != null)
StopCoroutine(coroutines[Area]);
coroutines[Area] = FadeOut(Area, Materials[Area]);
StartCoroutine(coroutines[Area]);
}
}
public IEnumerator FadeOut(int Area, Material mat)
{
for (float time = 0f; time < FadeDuration; time += Time.deltaTime)
{
float p = 1 - time / FadeDuration;
mat.SetColor("_EmissionColor", new Color(p, p, p, 1f));
yield return null;
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e3360ac0e0b46c140a379d23f08f784e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -22,7 +22,7 @@ public class ColliderToSerial : MonoBehaviour
_insideColliderCount += 1;
Serial.SetTouch(Area, true);
touchDidChange?.Invoke();
lightManager.UpdateLight(Area, true);
lightManager.UpdateLightFade(Area, true);
}
private void OnTriggerExit(Collider other)
@ -33,7 +33,7 @@ public class ColliderToSerial : MonoBehaviour
{
Serial.SetTouch(Area, false);
touchDidChange?.Invoke();
lightManager.UpdateLight(Area, false);
lightManager.UpdateLightFade(Area, false);
}
}
}

View File

@ -0,0 +1,16 @@
{
"name": "Serial",
"rootNamespace": "",
"references": [
"GUID:476196b3fd6829e45b839eb138f356ed"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a2eddfd5d8155c94099c891d82150756
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -19,6 +19,7 @@ public class Serial : MonoBehaviour
private Thread _touchThread;
private Queue _touchQueue;
static SerialPort ComL = new SerialPort ("COM5", 115200);
static SerialPort ComR = new SerialPort ("COM6", 115200);
@ -29,10 +30,10 @@ public class Serial : MonoBehaviour
string read2 = " 11 11 11 128 103 103 115 138 127 103 105 111 126 113 95 100";
string read3 = " 101 115 98 86 76 67 68 48 117 0 82 154 0 6 35 4";
byte[] SettingData_160 = new byte[8];
byte[] SettingData_162 = new byte[7];
byte[] SettingData_148 = new byte[7];
byte[] SettingData_201 = new byte[7];
byte[] SettingData_160 = new byte[8] {160, 49, 57, 48, 53, 50, 51, 44};
byte[] SettingData_162 = new byte[3] {162, 63, 29};
byte[] SettingData_148 = new byte[3] {148, 0, 20};
byte[] SettingData_201 = new byte[3] {201, 0, 73};
static byte[] TouchPackL = new byte[36];
static byte[] TouchPackR = new byte[36];
public static bool[] TouchPackAll = new bool[240];
@ -49,10 +50,6 @@ public class Serial : MonoBehaviour
Console.WriteLine($"Failed to Open Serial Ports: {ex}");
}
//Debug.Log("Touch Serial Initializing..");
SetSettingData_160();
SetSettingData_201();
SetSettingData_162();
SetSettingData_148();
//Send touch update periodically to keep "read" alive
_touchQueue = Queue.Synchronized(new Queue());
_touchThread = new Thread(TouchThreadLoop);
@ -105,9 +102,6 @@ public class Serial : MonoBehaviour
SendTouch(ComR, TouchPackR);
}
}
private void FixedUpdate() {
//SendTouchState();
}
IEnumerator TouchTest(bool State) //this is a touch test code
{
@ -129,7 +123,6 @@ public class Serial : MonoBehaviour
var data = Serial.ReadExisting();
SendResp(Serial, side, data);
}
}
void SendResp(SerialPort Serial, int side, string data)
{
@ -233,13 +226,7 @@ public class Serial : MonoBehaviour
void SendTouch(SerialPort Serial, byte[] Pack) //Send touch data
{
if (StartUp)
{
// Debug.Log($"Pack {string.Join(" ", Pack)}");
var output = GetTouchPack(Pack);
// Debug.Log($"Output {string.Join(" ", output)}");
Serial.Write(output, 0, 36);
}
Serial.Write(GetTouchPack(Pack), 0, 36);
}
public static void SetTouch(int Area, bool State) //set touch data 0-239
{
@ -257,36 +244,6 @@ public class Serial : MonoBehaviour
}
TouchPackAll[Area] = State;
}
void SetSettingData_160()
{
SettingData_160[0]=160;
SettingData_160[1]=49;
SettingData_160[2]=57;
SettingData_160[3]=48;
SettingData_160[4]=53;
SettingData_160[5]=50;
SettingData_160[6]=51;
SettingData_160[7]=44;
}
void SetSettingData_201()
{
SettingData_201[0]=201;
SettingData_201[1]=0;
SettingData_201[2]=73;
}
void SetSettingData_162()
{
SettingData_162[0]=162;
SettingData_162[1]=63;
SettingData_162[2]=29;
}
void SetSettingData_148()
{
SettingData_148[0]=148;
SettingData_148[1]=0;
SettingData_148[2]=20;
}
}
public static class ByteHelper

View File

@ -35,6 +35,7 @@ MonoBehaviour:
features:
- {fileID: 7581227243671795047}
- {fileID: -3687958811547312280}
- {fileID: 6797662432667753210}
- {fileID: -660904743828199304}
- {fileID: 587458779450762736}
- {fileID: 2332717924642193878}
@ -85,6 +86,26 @@ MonoBehaviour:
company: Unity
priority: 0
required: 0
--- !u!114 &-3229542617603246248
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c465bd23c9c4fb442ae89117552a5f3f, type: 3}
m_Name: HandTrackingFeature Standalone
m_EditorClassIdentifier:
m_enabled: 1
nameUi: Ultraleap Hand Tracking
version: 1.0.0
featureIdInternal: com.ultraleap.tracking.openxr.feature.handtracking
openxrExtensionStrings: XR_EXT_hand_tracking XR_ULTRALEAP_hand_tracking_forearm
company: Ultraleap
priority: 0
required: 0
--- !u!114 &-660904743828199304
MonoBehaviour:
m_ObjectHideFlags: 0
@ -223,6 +244,26 @@ MonoBehaviour:
priority: 0
required: 0
ignoreValidationErrors: 0
--- !u!114 &6797662432667753210
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c465bd23c9c4fb442ae89117552a5f3f, type: 3}
m_Name: HandTrackingFeature Standalone
m_EditorClassIdentifier:
m_enabled: 1
nameUi: Ultraleap Hand Tracking
version: 1.0.0
featureIdInternal: com.ultraleap.tracking.openxr.feature.handtracking
openxrExtensionStrings: XR_EXT_hand_tracking XR_ULTRALEAP_hand_tracking_forearm
company: Ultraleap
priority: 0
required: 0
--- !u!114 &7581227243671795047
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -1,20 +1,19 @@
{
"dependencies": {
"com.hecomi.uwindowcapture": "https://github.com/hecomi/uWindowCapture.git#upm",
"com.unity.collab-proxy": "1.15.17",
"com.unity.ide.rider": "3.0.13",
"com.unity.ide.visualstudio": "2.0.15",
"com.ultraleap.tracking": "5.11.0",
"com.ultraleap.tracking.openxr": "1.0.0-pre.5",
"com.unity.ide.visualstudio": "2.0.16",
"com.unity.ide.vscode": "1.2.5",
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.render-pipelines.universal": "12.1.6",
"com.unity.test-framework": "1.1.31",
"com.unity.test-framework": "2.0.1-pre.18",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.4",
"com.unity.ugui": "1.0.0",
"com.unity.visualscripting": "1.7.8",
"com.unity.xr.interaction.toolkit": "2.1.0-pre.1",
"com.unity.xr.management": "4.2.1",
"com.unity.xr.oculus": "3.0.1",
"com.unity.xr.openxr": "1.4.1",
"com.unity.xr.oculus": "3.0.2",
"com.unity.xr.openxr": "1.4.2",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
@ -46,5 +45,14 @@
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
},
"scopedRegistries": [
{
"name": "Ultraleap",
"url": "https://package.openupm.com",
"scopes": [
"com.ultraleap"
]
}
]
}

View File

@ -7,6 +7,23 @@
"dependencies": {},
"hash": "0412fe09e11d3720197707a935f8114cc2454639"
},
"com.ultraleap.tracking": {
"version": "5.11.0",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://package.openupm.com"
},
"com.ultraleap.tracking.openxr": {
"version": "1.0.0-pre.5",
"depth": 0,
"source": "registry",
"dependencies": {
"com.ultraleap.tracking": "5.7.0",
"com.unity.xr.openxr": "1.3.1"
},
"url": "https://package.openupm.com"
},
"com.unity.burst": {
"version": "1.6.5",
"depth": 1,
@ -16,33 +33,15 @@
},
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.15.17",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.services.core": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"version": "2.0.2",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.13",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.15",
"version": "2.0.16",
"depth": 0,
"source": "registry",
"dependencies": {
@ -75,7 +74,7 @@
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.0.2",
"depth": 2,
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
@ -108,17 +107,6 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.3.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.modules.androidjni": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.shadergraph": {
"version": "12.1.6",
"depth": 1,
@ -138,11 +126,11 @@
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.31",
"version": "2.0.1-pre.18",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6",
"com.unity.ext.nunit": "2.0.2",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
@ -157,18 +145,6 @@
},
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.6.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.modules.director": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,
@ -178,16 +154,6 @@
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.visualscripting": {
"version": "1.7.8",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.xr.core-utils": {
"version": "2.0.0",
"depth": 1,
@ -236,7 +202,7 @@
"url": "https://packages.unity.com"
},
"com.unity.xr.oculus": {
"version": "3.0.1",
"version": "3.0.2",
"depth": 0,
"source": "registry",
"dependencies": {
@ -245,7 +211,7 @@
"url": "https://packages.unity.com"
},
"com.unity.xr.openxr": {
"version": "1.4.1",
"version": "1.4.2",
"depth": 0,
"source": "registry",
"dependencies": {

View File

@ -4,7 +4,7 @@
PhysicsManager:
m_ObjectHideFlags: 0
serializedVersion: 13
m_Gravity: {x: 0, y: -9.81, z: 0}
m_Gravity: {x: 0, y: -4.905, z: 0}
m_DefaultMaterial: {fileID: 0}
m_BounceThreshold: 2
m_DefaultMaxDepenetrationVelocity: 10

View File

@ -25,11 +25,18 @@ MonoBehaviour:
m_Scopes: []
m_IsDefault: 1
m_Capabilities: 7
m_UserSelectedRegistryName:
- m_Id: scoped:Ultraleap
m_Name: Ultraleap
m_Url: https://package.openupm.com
m_Scopes:
- com.ultraleap
m_IsDefault: 0
m_Capabilities: 0
m_UserSelectedRegistryName: Ultraleap
m_UserAddingNewScopedRegistry: 0
m_RegistryInfoDraft:
m_Modified: 0
m_ErrorMessage:
m_UserModificationsInstanceId: -824
m_OriginalInstanceId: -826
m_UserModificationsInstanceId: -826
m_OriginalInstanceId: -828
m_LoadAssets: 0

View File

@ -3,7 +3,7 @@
--- !u!19 &1
Physics2DSettings:
m_ObjectHideFlags: 0
serializedVersion: 4
serializedVersion: 5
m_Gravity: {x: 0, y: -9.81}
m_DefaultMaterial: {fileID: 0}
m_VelocityIterations: 8
@ -38,13 +38,13 @@ Physics2DSettings:
m_IslandSolverJointCostScale: 10
m_IslandSolverBodiesPerJob: 50
m_IslandSolverContactsPerJob: 50
m_AutoSimulation: 1
m_SimulationMode: 0
m_QueriesHitTriggers: 1
m_QueriesStartInColliders: 1
m_CallbacksOnDisable: 1
m_ReuseCollisionCallbacks: 0
m_AutoSyncTransforms: 0
m_AlwaysShowColliders: 0
m_AlwaysShowColliders: 1
m_ShowColliderSleep: 1
m_ShowColliderContacts: 0
m_ShowColliderAABB: 0

View File

@ -8,21 +8,26 @@ A VR arcade emulator
- Successfully initialized touch
- Successfully send touch signal
- Successfully enabled Freeplay and tested the touch signal in game
- Successfully got led data from game
## Current issue
- capture display white screen issue (set game priority in taskmanager to real-time many solve)
- capture display white screen issue (set game priority in taskmanager to real-time may solve)
## Quick guide
- Port binding is same as my other repo MaiDXR
- Port binding is same as my other repo [MaiDXR](https://github.com/xiaopeng12138/MaiDXR)
- add "[touch] enable=0" to ini file
- The led requiere a special fork of the tools. Currently it's under my fork of the tools and it's not in the github! You need to build by your self and replace the things inside mercuryio folder whit the one under this repo.
## Configuration
A ``config.json`` is automatically created in the WACVR root on startup
- ``useSkybox``: Enable Skybox and hide the room (Default: false)
- ``Skybox``: the current skybox selected for use (Default: 0)
- ``Height``: the offset from default height that the player is moved (Default: 0.0)
- ``HandSize``: the size of hands (Default: 7.0)
- ``HandPosition``: the offset of hand position (Default: [1.0, 1.0, -3.0],)
- ``ThirdPerson``: whether or not the camera is in third person (Default: true)
- ``CaptureMode``: the method uWindowCapture will use for window capture
- ``0``: PrintScreen
@ -32,7 +37,12 @@ A ``config.json`` is automatically created in the WACVR root on startup
- ``CaptureFramerate``: the framerate to capture the game at (Default: 60)
- ``CaptureDesktop``: whether to capture the specific window or a full monitor
- ``CaptureDesktopNumber``: the monitor to capture if you're capturing a full monitor
- ``PhysicFPS``: the unity physic interval, lower value can prevent false touch but will also cause higher latency (Default: 90)
- ``useIPC``: the touch panle LED light mode, requiere mercuryio and new tools (Default: true)
## Why this repo now?
## When release?
- currently you can get the latest build in actions (in artifacts)
- the first release version will release after 8.31
I don't have much time and enough skills to make this project by myself. I'm not familiar with Unreal Engine etc. So I want this project to be a community project.
Huge thanks to everyone that helped this project!
If you want to add any function pls commit PR, I will accept it as soon as possible!

164
mercuryio/mercuryio.c Normal file
View File

@ -0,0 +1,164 @@
#include <windows.h>
#include <process.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <process.h>
#include "mercuryio/mercuryio.h"
#include "mercuryio/config.h"
#include "mercuryhook/elisabeth.h"
#include "util/dprintf.h"
static unsigned int __stdcall mercury_io_touch_thread_proc(void *ctx);
static uint8_t mercury_opbtn;
static uint8_t mercury_gamebtn;
static struct mercury_io_config mercury_io_cfg;
static bool mercury_io_touch_stop_flag;
static HANDLE mercury_io_touch_thread;
struct IPCMemoryInfo
{
uint8_t testBtn;
uint8_t serviceBtn;
uint8_t coinBtn;
uint8_t cardRead;
uint8_t TouchIoStatus[240];
uint8_t RGBAData[480 * 4];
};
typedef struct IPCMemoryInfo IPCMemoryInfo;
static HANDLE FileMappingHandle;
IPCMemoryInfo* FileMapping;
void initSharedMemory()
{
dprintf("initSharedMemory\n");
dprintf("SharedMemory Size: %d\n", (char)sizeof(IPCMemoryInfo));
if (FileMapping)
return;
if ((FileMappingHandle = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, sizeof(IPCMemoryInfo), "Local\\WACVR_SHARED_BUFFER")) == 0)
{
dprintf("FileMappingHandle Error\n");
return;
}
if ((FileMapping = (IPCMemoryInfo*)MapViewOfFile(FileMappingHandle, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(IPCMemoryInfo))) == 0)
{
dprintf("FileMapping Error\n");
return;
}
memset(FileMapping, 0, sizeof(IPCMemoryInfo));
SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_CONTINUOUS);
}
uint16_t mercury_io_get_api_version(void)
{
return 0x0100;
}
HRESULT mercury_io_init(void)
{
mercury_io_config_load(&mercury_io_cfg, L".\\segatools.ini");
initSharedMemory();
return S_OK;
}
HRESULT mercury_io_poll(void)
{
mercury_opbtn = 0;
mercury_gamebtn = 0;
if ((FileMapping && FileMapping->testBtn) || GetAsyncKeyState(mercury_io_cfg.vk_test)) {
mercury_opbtn |= MERCURY_IO_OPBTN_TEST;
}
if ((FileMapping && FileMapping->serviceBtn) || GetAsyncKeyState(mercury_io_cfg.vk_service)) {
mercury_opbtn |= MERCURY_IO_OPBTN_SERVICE;
}
if ((FileMapping && FileMapping->coinBtn) || GetAsyncKeyState(mercury_io_cfg.vk_coin)) {
mercury_opbtn |= MERCURY_IO_OPBTN_COIN;
}
if (GetAsyncKeyState(mercury_io_cfg.vk_vol_up)) {
mercury_gamebtn |= MERCURY_IO_GAMEBTN_VOL_UP;
}
if (GetAsyncKeyState(mercury_io_cfg.vk_vol_down)) {
mercury_gamebtn |= MERCURY_IO_GAMEBTN_VOL_DOWN;
}
return S_OK;
}
void mercury_io_get_opbtns(uint8_t *opbtn)
{
if (opbtn != NULL) {
*opbtn = mercury_opbtn;
}
}
void mercury_io_get_gamebtns(uint8_t *gamebtn)
{
if (gamebtn != NULL) {
*gamebtn = mercury_gamebtn;
}
}
HRESULT mercury_io_touch_init(void)
{
return S_OK;
}
void mercury_io_touch_start(mercury_io_touch_callback_t callback)
{
if (mercury_io_touch_thread != NULL) {
return;
}
mercury_io_touch_thread = (HANDLE) _beginthreadex(
NULL,
0,
mercury_io_touch_thread_proc,
callback,
0,
NULL
);
}
void mercury_io_touch_set_leds(struct led_data data)
{
if (FileMapping)
{
memcpy(FileMapping->RGBAData, data.rgba, 480 * 4);
}
//for (size_t i = 0; i < 32; i++)
// dprintf("LED.R: %d\n", data.rgba[i].red);
}
static unsigned int __stdcall mercury_io_touch_thread_proc(void *ctx)
{
mercury_io_touch_callback_t callback;
bool cellPressed[240];
callback = ctx;
while (!mercury_io_touch_stop_flag) {
if (FileMapping) {
memcpy(cellPressed, FileMapping->TouchIoStatus, 240);
}
callback(cellPressed);
Sleep(1);
}
return 0;
}

11
mercuryio/mercuryio.def Normal file
View File

@ -0,0 +1,11 @@
LIBRARY mercuryio
EXPORTS
mercury_io_get_api_version
mercury_io_init
mercury_io_poll
mercury_io_get_opbtns
mercury_io_get_gamebtns
mercury_io_touch_init
mercury_io_touch_start
mercury_io_touch_set_leds

70
mercuryio/mercuryio.h Normal file
View File

@ -0,0 +1,70 @@
#pragma once
#include <windows.h>
#include <stdint.h>
#include "mercuryhook/elisabeth.h"
enum {
MERCURY_IO_OPBTN_TEST = 0x01,
MERCURY_IO_OPBTN_SERVICE = 0x02,
MERCURY_IO_OPBTN_COIN = 0x04,
};
enum {
MERCURY_IO_GAMEBTN_VOL_UP = 0x01,
MERCURY_IO_GAMEBTN_VOL_DOWN = 0x02,
};
typedef void (*mercury_io_touch_callback_t)(const bool *state);
/* Get the version of the Wacca IO API that this DLL supports. This
function should return a positive 16-bit integer, where the high byte is
the major version and the low byte is the minor version (as defined by the
Semantic Versioning standard).
The latest API version as of this writing is 0x0100. */
uint16_t mercury_io_get_api_version(void);
/* Initialize the IO DLL. This is the second function that will be called on
your DLL, after mercury_io_get_api_version.
All subsequent calls to this API may originate from arbitrary threads.
Minimum API version: 0x0100 */
HRESULT mercury_io_init(void);
/* Send any queued outputs (of which there are currently none, though this may
change in subsequent API versions) and retrieve any new inputs.
Minimum API version: 0x0100 */
HRESULT mercury_io_poll(void);
/* Get the state of the cabinet's operator buttons as of the last poll. See
MERCURY_IO_OPBTN enum above: this contains bit mask definitions for button
states returned in *opbtn. All buttons are active-high.
Minimum API version: 0x0100 */
void mercury_io_get_opbtns(uint8_t *opbtn);
/* Get the state of the cabinet's gameplay buttons as of the last poll. See
MERCURY_IO_GAMEBTN enum above for bit mask definitions. Inputs are split into
a left hand side set of inputs and a right hand side set of inputs: the bit
mappings are the same in both cases.
All buttons are active-high, even though some buttons' electrical signals
on a real cabinet are active-low.
Minimum API version: 0x0100 */
void mercury_io_get_gamebtns(uint8_t *gamebtn);
HRESULT mercury_io_touch_init(void);
void mercury_io_touch_start(mercury_io_touch_callback_t callback);
void mercury_io_touch_set_leds(struct led_data data);

25
mercuryio/meson.build Normal file
View File

@ -0,0 +1,25 @@
mercuryio_lib = static_library(
'mercuryio',
name_prefix : '',
include_directories : inc,
implicit_include_directories : false,
c_pch : '../precompiled.h',
link_with : [
util_lib,
],
sources : [
'mercuryio.c',
'mercuryio.h',
'config.c',
'config.h',
],
)
shared_library(
'mercuryio',
name_prefix : '',
vs_module_defs : 'mercuryio.def',
link_with : [
mercuryio_lib,
],
)