new control method working
This commit is contained in:
parent
4abcf9877c
commit
29ef0e1214
14 changed files with 332 additions and 418 deletions
|
@ -527,6 +527,37 @@ MeshFilter:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 42838980}
|
||||
m_Mesh: {fileID: 0}
|
||||
--- !u!1 &45752346
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 45752347}
|
||||
m_Layer: 9
|
||||
m_Name: Con
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &45752347
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 45752346}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -0.133, z: -0.217}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1318561811}
|
||||
m_Father: {fileID: 416451006}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &79236691
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -810,6 +841,132 @@ MeshFilter:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 81886393}
|
||||
m_Mesh: {fileID: 0}
|
||||
--- !u!1 &114864357
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 114864359}
|
||||
- component: {fileID: 114864358}
|
||||
m_Layer: 0
|
||||
m_Name: Pull Line
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!120 &114864358
|
||||
LineRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 114864357}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 0
|
||||
m_MotionVectors: 0
|
||||
m_LightProbeUsage: 0
|
||||
m_ReflectionProbeUsage: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10306, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Positions:
|
||||
- {x: 0, y: 0, z: 0}
|
||||
- {x: 0, y: 0, z: 1}
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 0.1
|
||||
widthCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
colorGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 0.627451, b: 1, a: 1}
|
||||
key1: {r: 0.9811321, g: 0.5322179, b: 0.64302593, a: 1}
|
||||
key2: {r: 0, g: 0, b: 0, a: 0}
|
||||
key3: {r: 0, g: 0, b: 0, a: 0}
|
||||
key4: {r: 0, g: 0, b: 0, a: 0}
|
||||
key5: {r: 0, g: 0, b: 0, a: 0}
|
||||
key6: {r: 0, g: 0, b: 0, a: 0}
|
||||
key7: {r: 0, g: 0, b: 0, a: 0}
|
||||
ctime0: 0
|
||||
ctime1: 65535
|
||||
ctime2: 0
|
||||
ctime3: 0
|
||||
ctime4: 0
|
||||
ctime5: 0
|
||||
ctime6: 0
|
||||
ctime7: 0
|
||||
atime0: 0
|
||||
atime1: 65535
|
||||
atime2: 0
|
||||
atime3: 0
|
||||
atime4: 0
|
||||
atime5: 0
|
||||
atime6: 0
|
||||
atime7: 0
|
||||
m_Mode: 0
|
||||
m_NumColorKeys: 2
|
||||
m_NumAlphaKeys: 2
|
||||
numCornerVertices: 0
|
||||
numCapVertices: 0
|
||||
alignment: 0
|
||||
textureMode: 0
|
||||
shadowBias: 0.5
|
||||
generateLightingData: 0
|
||||
m_UseWorldSpace: 0
|
||||
m_Loop: 0
|
||||
--- !u!4 &114864359
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 114864357}
|
||||
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: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &202625280
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1330,7 +1487,7 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 5
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &343354975
|
||||
AudioSource:
|
||||
|
@ -1671,7 +1828,7 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 6
|
||||
m_RootOrder: 8
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &408032442
|
||||
MonoBehaviour:
|
||||
|
@ -1715,12 +1872,12 @@ Transform:
|
|||
m_GameObject: {fileID: 416451005}
|
||||
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_LocalScale: {x: 60, y: 60, z: 60}
|
||||
m_Children:
|
||||
- {fileID: 1554483892}
|
||||
- {fileID: 963194228}
|
||||
- {fileID: 45752347}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &416451007
|
||||
MonoBehaviour:
|
||||
|
@ -1738,6 +1895,7 @@ MonoBehaviour:
|
|||
main: {fileID: 1796811812}
|
||||
disconnected: {fileID: 1638248270}
|
||||
head: {fileID: 963194228}
|
||||
con: {fileID: 45752347}
|
||||
hangingRod: {fileID: 1554483892}
|
||||
recordCam: {fileID: 850212509}
|
||||
remote: 0
|
||||
|
@ -1747,8 +1905,8 @@ MonoBehaviour:
|
|||
joystick: {x: 0, y: 0, z: 0}
|
||||
boxShake: {x: 0, y: 0, z: 0}
|
||||
boxOffset: {x: 0, y: 0, z: 0}
|
||||
ready: 0
|
||||
alignRecordCam: 0
|
||||
alignRecordCam: 1
|
||||
pullLine: {fileID: 114864358}
|
||||
--- !u!1 &434999704
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -3168,11 +3326,11 @@ Camera:
|
|||
far clip plane: 100
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 6
|
||||
orthographic size: 10
|
||||
m_Depth: 1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 311
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
|
@ -3824,7 +3982,7 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 7
|
||||
m_RootOrder: 9
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &950738597
|
||||
GameObject:
|
||||
|
@ -4108,11 +4266,11 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 963194225}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 3.54, z: -22}
|
||||
m_LocalScale: {x: 60, y: 60, z: 60}
|
||||
m_LocalPosition: {x: 0, y: 0.059, z: -0.36666667}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 416451006}
|
||||
m_RootOrder: 1
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &963194229
|
||||
MonoBehaviour:
|
||||
|
@ -5713,6 +5871,83 @@ MeshFilter:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1317232481}
|
||||
m_Mesh: {fileID: 4300016, guid: 1cc1b125262248c4ba967763bf40c861, type: 3}
|
||||
--- !u!1 &1318561810
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1318561811}
|
||||
- component: {fileID: 1318561813}
|
||||
- component: {fileID: 1318561812}
|
||||
m_Layer: 9
|
||||
m_Name: Mesh
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1318561811
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1318561810}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.016666668, y: 0.016666668, z: 0.016666668}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 45752347}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &1318561812
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1318561810}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: bb5f41eecb5ccc546814746a66914984, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &1318561813
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1318561810}
|
||||
m_Mesh: {fileID: 4300096, guid: 1cc1b125262248c4ba967763bf40c861, type: 3}
|
||||
--- !u!1 &1366624816
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -6592,7 +6827,7 @@ Transform:
|
|||
- {fileID: 580349063}
|
||||
- {fileID: 2101684220}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &1510915031
|
||||
AudioSource:
|
||||
|
@ -6796,8 +7031,8 @@ Transform:
|
|||
m_LocalPosition: {x: 0, y: 2.82, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 416451006}
|
||||
m_RootOrder: 0
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &1554483893
|
||||
MeshRenderer:
|
||||
|
@ -7075,7 +7310,7 @@ Transform:
|
|||
- {fileID: 950738598}
|
||||
- {fileID: 662602231}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 9
|
||||
m_RootOrder: 11
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1643476466
|
||||
GameObject:
|
||||
|
@ -7462,7 +7697,7 @@ Transform:
|
|||
m_Children:
|
||||
- {fileID: 351576464}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1821719418
|
||||
GameObject:
|
||||
|
@ -7588,7 +7823,7 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
m_RootOrder: 6
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1825209466
|
||||
GameObject:
|
||||
|
@ -8311,7 +8546,7 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 8
|
||||
m_RootOrder: 10
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &2081994160
|
||||
AudioSource:
|
||||
|
|
|
@ -112,14 +112,17 @@ public class BoxUI : MonoBehaviour
|
|||
|
||||
void Start()
|
||||
{
|
||||
Rig.OnReady += RigReady;
|
||||
Main.OnGameStart += GameStart;
|
||||
Game.OnCrash += Crash;
|
||||
|
||||
|
||||
Screen.SetResolution(1280, 720, false);
|
||||
|
||||
UpdateLabel();
|
||||
|
||||
trackText.text = main.soundData.musicLoop.name;
|
||||
trackColor.a = 0.5f;
|
||||
|
||||
// PlayerPref Defaults
|
||||
int playCount = PlayerPrefs.GetInt("PlayCount", 0);
|
||||
if (playCount == 0)
|
||||
|
@ -184,12 +187,6 @@ public class BoxUI : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
void RigReady()
|
||||
{
|
||||
trackText.text = main.soundData.musicLoop.name;
|
||||
trackColor.a = 0.5f;
|
||||
}
|
||||
|
||||
void GameStart(Main main)
|
||||
{
|
||||
trackText.text = main.soundData.musicTrack.name;
|
||||
|
@ -238,7 +235,7 @@ public class BoxUI : MonoBehaviour
|
|||
int oldScore = 0;
|
||||
void Update()
|
||||
{
|
||||
backDown = OVRInput.GetDown(OVRInput.Button.Two, main.rig.remote);
|
||||
backDown = OVRInput.GetDown(OVRInput.Button.Two, main.rig.ovrCon);
|
||||
|
||||
if (main.snake.Count != oldScore)
|
||||
{
|
||||
|
@ -304,12 +301,12 @@ public class BoxUI : MonoBehaviour
|
|||
}
|
||||
|
||||
// SWIPE SYSTEM FOR OCULUS GO AND GEAR VR
|
||||
if (OVRInput.Get(OVRInput.Touch.PrimaryTouchpad, main.rig.remote))
|
||||
if (OVRInput.Get(OVRInput.Touch.PrimaryTouchpad, main.rig.ovrCon))
|
||||
{
|
||||
touchPos = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad, main.rig.remote);
|
||||
touchPos = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad, main.rig.ovrCon);
|
||||
}
|
||||
|
||||
if (OVRInput.GetUp(OVRInput.Touch.PrimaryTouchpad, main.rig.remote))
|
||||
if (OVRInput.GetUp(OVRInput.Touch.PrimaryTouchpad, main.rig.ovrCon))
|
||||
{
|
||||
// check direction
|
||||
if (touchPos.x < 0)
|
||||
|
@ -331,7 +328,7 @@ public class BoxUI : MonoBehaviour
|
|||
audioSource.PlayOneShot(sfxHover);
|
||||
}
|
||||
|
||||
if (OVRInput.GetDown(OVRInput.Button.PrimaryThumbstickLeft, main.rig.remote))
|
||||
if (OVRInput.GetDown(OVRInput.Button.PrimaryThumbstickLeft, main.rig.ovrCon))
|
||||
{
|
||||
if (cursorIndex > 0)
|
||||
{
|
||||
|
@ -345,7 +342,7 @@ public class BoxUI : MonoBehaviour
|
|||
audioSource.PlayOneShot(sfxHover);
|
||||
}
|
||||
|
||||
if (OVRInput.GetDown(OVRInput.Button.PrimaryThumbstickRight, main.rig.remote))
|
||||
if (OVRInput.GetDown(OVRInput.Button.PrimaryThumbstickRight, main.rig.ovrCon))
|
||||
{
|
||||
cursorIndex++;
|
||||
|
||||
|
@ -394,7 +391,7 @@ public class BoxUI : MonoBehaviour
|
|||
{
|
||||
uiButtons[buttonIndex].localScale = Vector3.one * 1.3f;
|
||||
|
||||
if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger, main.rig.remote))
|
||||
if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger, main.rig.ovrCon))
|
||||
{
|
||||
audioSource.PlayOneShot(sfxClick);
|
||||
|
||||
|
@ -487,7 +484,7 @@ public class BoxUI : MonoBehaviour
|
|||
{
|
||||
uiSteppers[stepperIndex].localScale = Vector3.one * 1.2f;
|
||||
|
||||
if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger, main.rig.remote))
|
||||
if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger, main.rig.ovrCon))
|
||||
{
|
||||
audioSource.PlayOneShot(sfxClick);
|
||||
|
||||
|
|
|
@ -154,32 +154,6 @@ public class GraphX
|
|||
|
||||
rollTime = Mathf.Clamp01((60 / (float)main.bpm) / 27);
|
||||
}
|
||||
|
||||
// if (!main.sideQuest)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
controllerMatrix.SetTRS(
|
||||
main.rig.controllerPos,
|
||||
main.rig.controllerRot * Quaternion.Euler(Vector3.up * 90),
|
||||
Vector3.one * main.design.scale
|
||||
); Graphics.DrawMesh(data.controllerMesh, controllerMatrix, data.unlitMat, 9);
|
||||
|
||||
conArrowMatrix.SetTRS(
|
||||
main.rig.controllerPos,
|
||||
main.rig.inputRot,
|
||||
Vector3.one * main.design.scale
|
||||
); Graphics.DrawMesh(data.conArrowMesh, conArrowMatrix, data.unlitMat, 9);
|
||||
|
||||
Vector3 pointTo = main.rig.inputRot * Vector3.Lerp(Vector3.up, Vector3.forward, main.rig.joystick.magnitude / 3);
|
||||
|
||||
// * Quaternion.Euler(Vector3.right * -90)
|
||||
joystickMatrix.SetTRS(
|
||||
main.rig.controllerPos,
|
||||
Quaternion.LookRotation(pointTo),
|
||||
Vector3.one * main.design.scale
|
||||
); Graphics.DrawMesh(data.joystickMesh, joystickMatrix, data.unlitMat, 9);
|
||||
}
|
||||
|
||||
float rollTime;
|
||||
|
|
|
@ -13,10 +13,6 @@ public class GraphXData : ScriptableObject
|
|||
public Material unlitMat;
|
||||
public Material wetMat;
|
||||
|
||||
[Header("Controls")]
|
||||
public Mesh controllerMesh;
|
||||
public Mesh joystickMesh, conArrowMesh;
|
||||
|
||||
[Header("Faces")]
|
||||
public Mesh faceMesh;
|
||||
public Mesh faceDefault, faceEat, faceEaten, faceBump, faceBoxGameover, faceSelfGameover, faceHyper;
|
||||
|
|
|
@ -3,18 +3,15 @@ using UnityEngine.XR;
|
|||
|
||||
public class Rig : MonoBehaviour
|
||||
{
|
||||
public delegate void Ready();
|
||||
public static event Ready OnReady;
|
||||
|
||||
[Header("References")]
|
||||
public Design design;
|
||||
public Main main;
|
||||
public GameObject disconnected;
|
||||
public Transform head, hangingRod;
|
||||
public Transform head, con, hangingRod;
|
||||
public Camera recordCam;
|
||||
|
||||
[Header("Variables")]
|
||||
public OVRInput.Controller remote;
|
||||
public OVRInput.Controller ovrCon;
|
||||
public Quaternion controllerRot = Quaternion.identity;
|
||||
public Quaternion inputRot = Quaternion.identity;
|
||||
public Vector3 controllerPos, joystick;
|
||||
|
@ -23,7 +20,7 @@ public class Rig : MonoBehaviour
|
|||
Vector3 headOffset;
|
||||
public Vector3 boxShake, boxOffset;
|
||||
|
||||
public bool ready, alignRecordCam;
|
||||
public bool alignRecordCam;
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
@ -33,7 +30,6 @@ public class Rig : MonoBehaviour
|
|||
// headOffset.y = 32f;
|
||||
headOffset.y = design.headOffset.y;
|
||||
headOffset.z = design.headOffset.z;
|
||||
ready = false;
|
||||
|
||||
recordCam.gameObject.SetActive(Application.isEditor);
|
||||
}
|
||||
|
@ -48,9 +44,9 @@ public class Rig : MonoBehaviour
|
|||
|
||||
if (leftOn || rightOn || touchOn)
|
||||
{
|
||||
if (leftOn) { remote = OVRInput.Controller.LTrackedRemote; }
|
||||
else if (rightOn) { remote = OVRInput.Controller.RTrackedRemote; }
|
||||
else if (touchOn) { remote = OVRInput.Controller.RTouch; }
|
||||
if (leftOn) { ovrCon = OVRInput.Controller.LTrackedRemote; }
|
||||
else if (rightOn) { ovrCon = OVRInput.Controller.RTrackedRemote; }
|
||||
else if (touchOn) { ovrCon = OVRInput.Controller.RTouch; }
|
||||
|
||||
disconnected.SetActive(false);
|
||||
Time.timeScale = 1;
|
||||
|
@ -61,36 +57,27 @@ public class Rig : MonoBehaviour
|
|||
Time.timeScale = 0;
|
||||
}
|
||||
|
||||
// Apply to Transforms
|
||||
head.localPosition = InputTracking.GetLocalPosition(XRNode.Head);
|
||||
head.localRotation = InputTracking.GetLocalRotation(XRNode.Head);
|
||||
|
||||
// Rise Up Transition
|
||||
if (!ready && headOffset.y == design.headOffset.y)
|
||||
{
|
||||
OnReady();
|
||||
con.localPosition = InputTracking.GetLocalPosition(XRNode.RightHand);
|
||||
con.localRotation = InputTracking.GetLocalRotation(XRNode.RightHand);
|
||||
|
||||
ready = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
headOffset.y = Mathf.Lerp(headOffset.y, design.headOffset.y, Time.deltaTime);
|
||||
headOffset.z = Mathf.Lerp(headOffset.z, design.headOffset.z, Time.deltaTime);
|
||||
}
|
||||
|
||||
Quaternion headsetRot = InputTracking.GetLocalRotation(XRNode.Head);
|
||||
if (headsetRot != null)
|
||||
{
|
||||
head.rotation = headsetRot;
|
||||
// Quaternion.LookRotation(head.forward, head.up);
|
||||
hangingRod.position = design.pivotPos;
|
||||
hangingRod.rotation = headsetRot;
|
||||
head.position = design.pivotPos + (headsetRot * headOffset);
|
||||
head.localScale = Vector3.one * design.scale;
|
||||
}
|
||||
// °inview
|
||||
transform.localScale = Vector3.one * design.scale;
|
||||
transform.position = -head.localPosition * design.scale;
|
||||
transform.position += design.pivotPos + (head.rotation * headOffset);
|
||||
|
||||
// Shake
|
||||
boxShake = Vector3.Lerp(boxShake, (boxShake - boxOffset) * 0.5f, design.boxSpring * Time.deltaTime);
|
||||
boxOffset += boxShake * design.boxSpring * Time.deltaTime;
|
||||
transform.position += boxOffset;
|
||||
|
||||
head.position += boxOffset;
|
||||
|
||||
// Hanging Rod
|
||||
hangingRod.position = design.pivotPos;
|
||||
hangingRod.rotation = head.rotation;
|
||||
|
||||
// Record Cam
|
||||
Vector3 twoDir = new Vector3(head.position.x, 0, head.position.z).normalized;
|
||||
|
@ -101,22 +88,51 @@ public class Rig : MonoBehaviour
|
|||
recordCam.transform.rotation = Quaternion.LookRotation(-recPos);
|
||||
}
|
||||
|
||||
// Input Rotation
|
||||
// Vector3 headsetPos = InputTracking.GetLocalPosition(XRNode.Head);
|
||||
|
||||
// controllerRot = OVRInput.GetLocalControllerRotation(remote) * Quaternion.Euler(-30, 0, 0);
|
||||
Vector3 headsetPos = InputTracking.GetLocalPosition(XRNode.Head);
|
||||
// controllerPos = OVRInput.GetLocalControllerPosition(remote) * design.scale;
|
||||
// controllerPos = controllerPos - headsetPos * design.scale;
|
||||
// controllerPos += head.position;
|
||||
|
||||
controllerPos = OVRInput.GetLocalControllerPosition(remote) * design.scale;
|
||||
controllerPos = controllerPos - headsetPos * design.scale;
|
||||
controllerPos += head.position;
|
||||
inputRot = controllerRot = OVRInput.GetLocalControllerRotation(remote);
|
||||
// inputRot = controllerRot = OVRInput.GetLocalControllerRotation(remote);
|
||||
|
||||
joystick = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick, remote);
|
||||
joystick = new Vector3(joystick.x, 0, joystick.y);
|
||||
if (joystick.sqrMagnitude > 0)
|
||||
// joystick = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick, remote);
|
||||
// joystick = new Vector3(joystick.x, 0, joystick.y);
|
||||
// if (joystick.sqrMagnitude > 0)
|
||||
// {
|
||||
// inputRot *= Quaternion.LookRotation(joystick);
|
||||
// }
|
||||
|
||||
// Ignoring current implementation
|
||||
if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger, ovrCon))
|
||||
{
|
||||
inputRot *= Quaternion.LookRotation(joystick);
|
||||
pullFrom = con.localPosition;
|
||||
}
|
||||
|
||||
if (OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger, ovrCon))
|
||||
{
|
||||
pull = con.localPosition - pullFrom;
|
||||
if (pull.magnitude > 0.025f / 3)
|
||||
{
|
||||
rawDir = pull.normalized;
|
||||
}
|
||||
|
||||
// DRAG PIVOT
|
||||
pull = Vector3.ClampMagnitude(pull, 0.025f);
|
||||
pullFrom = con.localPosition - pull;
|
||||
}
|
||||
|
||||
inputRot = Quaternion.LookRotation(rawDir);
|
||||
|
||||
// visualize
|
||||
pullLine.SetPosition(0, transform.TransformPoint(pullFrom));
|
||||
pullLine.SetPosition(1, transform.TransformPoint(pullFrom + pull));
|
||||
}
|
||||
Vector3 rawDir = Vector3.forward;
|
||||
Vector3 pullFrom, pull;
|
||||
public LineRenderer pullLine;
|
||||
|
||||
|
||||
public Vector3Int InputDirection(Main main)
|
||||
{
|
||||
|
|
BIN
Assets/arow.fbx
BIN
Assets/arow.fbx
Binary file not shown.
|
@ -1,106 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 825a62388b1ce1040bc1eddefbc5ad23
|
||||
ModelImporter:
|
||||
serializedVersion: 23
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2100000: Material
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: Arrow
|
||||
7400000: Arrow|ArrowAction
|
||||
7400002: Arrow|CubeAction
|
||||
7400004: Arrow|CubeAction.001
|
||||
7400006: Arrow|Empty.001Action
|
||||
7400008: Arrow|EmptyAction
|
||||
7400010: Arrow|EmptyAction.001
|
||||
7400012: Arrow|JoystickAction
|
||||
9500000: //RootNode
|
||||
2186277476908879412: ImportLogs
|
||||
externalObjects: {}
|
||||
materials:
|
||||
importMaterials: 1
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
materialLocation: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
motionNodeName:
|
||||
rigImportErrors:
|
||||
rigImportWarnings:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
importAnimatedCustomProperties: 0
|
||||
importConstraints: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: 0.5
|
||||
animationPositionError: 0.5
|
||||
animationScaleError: 0.5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
extraUserProperties: []
|
||||
clipAnimations: []
|
||||
isReadable: 1
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 3
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
importVisibility: 1
|
||||
importBlendShapes: 1
|
||||
importCameras: 1
|
||||
importLights: 1
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
optimizeMeshForGPU: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
preserveHierarchy: 0
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
previousCalculatedGlobalScale: 0.099999994
|
||||
hasPreviousCalculatedGlobalScale: 1
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 3
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
importAnimation: 1
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
serializedVersion: 2
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 0
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
animationType: 2
|
||||
humanoidOversampling: 1
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
|
@ -1,97 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cb69a79fa4024c943846e5fefb4d90b4
|
||||
ModelImporter:
|
||||
serializedVersion: 23
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2100000: Material
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: Controller
|
||||
externalObjects: {}
|
||||
materials:
|
||||
importMaterials: 0
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
materialLocation: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
motionNodeName:
|
||||
rigImportErrors:
|
||||
rigImportWarnings:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
importAnimatedCustomProperties: 0
|
||||
importConstraints: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: 0.5
|
||||
animationPositionError: 0.5
|
||||
animationScaleError: 0.5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
extraUserProperties: []
|
||||
clipAnimations: []
|
||||
isReadable: 1
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 3
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
importVisibility: 1
|
||||
importBlendShapes: 1
|
||||
importCameras: 1
|
||||
importLights: 1
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
optimizeMeshForGPU: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
preserveHierarchy: 0
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
previousCalculatedGlobalScale: 1
|
||||
hasPreviousCalculatedGlobalScale: 0
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 3
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
importAnimation: 0
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
serializedVersion: 2
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 0
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
animationType: 0
|
||||
humanoidOversampling: 1
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
|
@ -52,6 +52,7 @@ ModelImporter:
|
|||
100092: WetBox
|
||||
100094: Face6
|
||||
100096: Face6Hyper
|
||||
100098: Controller
|
||||
400000: Arrow
|
||||
400002: //RootNode
|
||||
400004: Face0Default
|
||||
|
@ -101,6 +102,7 @@ ModelImporter:
|
|||
400092: WetBox
|
||||
400094: Face6
|
||||
400096: Face6Hyper
|
||||
400098: Controller
|
||||
2100000: No Name
|
||||
2300000: Arrow
|
||||
2300002: Face0Default
|
||||
|
@ -150,6 +152,7 @@ ModelImporter:
|
|||
2300090: WetBox
|
||||
2300092: Face6
|
||||
2300094: Face6Hyper
|
||||
2300096: Controller
|
||||
3300000: Arrow
|
||||
3300002: Face0Default
|
||||
3300004: Face1Eat
|
||||
|
@ -198,6 +201,7 @@ ModelImporter:
|
|||
3300090: WetBox
|
||||
3300092: Face6
|
||||
3300094: Face6Hyper
|
||||
3300096: Controller
|
||||
4300000: Arrow
|
||||
4300002: InsideOut
|
||||
4300004: Segment
|
||||
|
@ -246,6 +250,7 @@ ModelImporter:
|
|||
4300090: WetBox
|
||||
4300092: Face6
|
||||
4300094: Face6Hyper
|
||||
4300096: Controller
|
||||
9500000: //RootNode
|
||||
2186277476908879412: ImportLogs
|
||||
externalObjects: {}
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,106 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c1e013bed503e8f409f9c0ccc42890d4
|
||||
ModelImporter:
|
||||
serializedVersion: 23
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2100000: Material
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: Joystick
|
||||
7400000: Joystick|ArrowAction
|
||||
7400002: Joystick|CubeAction
|
||||
7400004: Joystick|CubeAction.001
|
||||
7400006: Joystick|Empty.001Action
|
||||
7400008: Joystick|EmptyAction
|
||||
7400010: Joystick|EmptyAction.001
|
||||
7400012: Joystick|JoystickAction
|
||||
9500000: //RootNode
|
||||
2186277476908879412: ImportLogs
|
||||
externalObjects: {}
|
||||
materials:
|
||||
importMaterials: 1
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
materialLocation: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
motionNodeName:
|
||||
rigImportErrors:
|
||||
rigImportWarnings:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
importAnimatedCustomProperties: 0
|
||||
importConstraints: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: 0.5
|
||||
animationPositionError: 0.5
|
||||
animationScaleError: 0.5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
extraUserProperties: []
|
||||
clipAnimations: []
|
||||
isReadable: 1
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 3
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
importVisibility: 1
|
||||
importBlendShapes: 1
|
||||
importCameras: 1
|
||||
importLights: 1
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
optimizeMeshForGPU: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
preserveHierarchy: 0
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
previousCalculatedGlobalScale: 0.099999994
|
||||
hasPreviousCalculatedGlobalScale: 1
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 3
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
importAnimation: 1
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
serializedVersion: 2
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 0
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
animationType: 2
|
||||
humanoidOversampling: 1
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in a new issue