Commit 07054fb5 authored by 15박보승's avatar 15박보승

Merge remote-tracking branch 'origin/master' into notemovement

parents 36134b91 194f76df
......@@ -121,7 +121,7 @@ Transform:
m_GameObject: {fileID: 8354046899824507571}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 10}
m_LocalScale: {x: 5, y: 5, z: 5}
m_LocalScale: {x: 10, y: 10, z: 10}
m_Children:
- {fileID: 2824711142497691445}
m_Father: {fileID: 0}
......
......@@ -27,13 +27,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4640709078173886784}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: 0.5, y: -0.5, z: 0.5, w: 0.5}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 10, y: 10, z: 1}
m_LocalScale: {x: 3, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 90}
--- !u!33 &4640709078173886787
MeshFilter:
m_ObjectHideFlags: 0
......
......@@ -27,13 +27,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4734231541000158423}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 10, y: 10, z: 1}
m_LocalScale: {x: 3, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!33 &4734231541000158424
MeshFilter:
m_ObjectHideFlags: 0
......
......@@ -27,13 +27,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1476454008853626150}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 10, y: 10, z: 1}
m_LocalScale: {x: 3, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!33 &1476454008853626155
MeshFilter:
m_ObjectHideFlags: 0
......
......@@ -27,13 +27,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4081910931583206819}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: 0.5, y: -0.5, z: 0.5, w: 0.5}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 10, y: 10, z: 1}
m_LocalScale: {x: 3, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 90}
--- !u!33 &4081910931583206814
MeshFilter:
m_ObjectHideFlags: 0
......
This diff is collapsed.
fileFormatVersion: 2
guid: e3f9757e6febe094f82a40085b363ff5
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 558045d2a2630cf428328893396ef21c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -27,7 +27,7 @@ RectTransform:
m_GameObject: {fileID: 8100479809720507869}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 5, y: 5, z: 1}
m_LocalScale: {x: 10, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
......@@ -35,7 +35,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 3.3, y: 3.3}
m_SizeDelta: {x: 6.6, y: 6.6}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8100479809720507870
CanvasRenderer:
......
This diff is collapsed.
fileFormatVersion: 2
guid: 552978e18fd475d44a20b08bee06ddc0
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 6721cd99a84a5f44ba24784505c01a9f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -21,10 +21,11 @@ class Level
if (judge.type != JudgeType.Ignore)
{
note.HandleJudge(judge);
note.Deactivate();
break;
}
note.HandleJudge(judge);
}
}
}
......
......@@ -6,7 +6,7 @@ public class EdgeNoteObject : NoteObject
{
[SerializeField]
private Vector3 direction;
private const float radius = 100f;
private const float radius = 10f;
public void Init(HandType hand)
{
......@@ -31,21 +31,17 @@ public class EdgeNoteObject : NoteObject
public override void SetPosition(float remainedTime)
{
if (remainedTime > 0.5f)
{
transform.position = new Vector3(0, 0, Mathf.Lerp(radius, 500, (remainedTime - 0.5f) * 2));
}
else
{
float angle = Mathf.Lerp(0, 90, Mathf.Pow(remainedTime * 2 - 1, 2));
transform.position = Quaternion.Euler(direction.x * angle, direction.y * angle, 0) * new Vector3(0, 0, radius);
transform.LookAt(Vector3.zero);
}
//transform.position = Vector3.Lerp(endPoint, endPoint + new Vector3(0, 0, 200), remainedTime);
//if (remainedTime > 0.5f)
//{
// transform.position = new Vector3(0, 0, Mathf.Lerp(radius, 500, (remainedTime - 0.5f) * 2));
//}
//else
//{
// float angle = Mathf.Lerp(0, 90, Mathf.Pow(remainedTime * 2 - 1, 2));
// transform.position = Quaternion.Euler(direction.x * angle, direction.y * angle, 0) * new Vector3(0, 0, radius);
// transform.LookAt(Vector3.zero);
//}
transform.position = endPoint + new Vector3(0, 0, 200) * remainedTime;
}
public override bool IsHit(Ray ray)
......
......@@ -16,9 +16,9 @@ public class ForwardNoteObject : NoteObject
//Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width * x, Screen.height * y, 0));
//endPoint = ray.GetPoint(perfectZ);
endPoint = new Vector3(-7.5f + 15 * x, -7.5f + 15 * y, perfectZ);
endPoint = new Vector3(-20f + 40 * x, -20.0f + 40 * y, perfectZ);
transform.position = endPoint + new Vector3(0, 0, 50);
transform.position = endPoint + new Vector3(0, 0, 15);
ring = IngameUIManager.inst.AddNoteRingUI();
ring.position = endPoint;
......@@ -89,6 +89,6 @@ public class ForwardNoteObject : NoteObject
public override bool IsHit(Ray ray)
{
RaycastHit hit;
return GetComponent<Collider>().Raycast(ray, out hit, 40);
return GetComponent<Collider>().Raycast(ray, out hit, 400);
}
}
......@@ -65,11 +65,13 @@ public abstract class NoteObject : MonoBehaviour
/*
var meshRenderer = gameObject.GetComponent<MeshRenderer>();
var trailRenderer = gameObject.GetComponent<TrailRenderer>();
if (meshRenderer) meshRenderer.enabled = false;
if (trailRenderer) trailRenderer.enabled = false;
*/
var trailRenderer = gameObject.GetComponent<TrailRenderer>();
if (trailRenderer) trailRenderer.enabled = false;
PlayEngine.inst.HandleNoteJudge(judge.type);
}
}
......
......@@ -32,6 +32,8 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
public SteamVR_Input_Sources leftHand;
public SteamVR_Input_Sources rightHand;
public GameObject player;
private int combo;
private int score;
......@@ -73,11 +75,28 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
if (level != null)
{
var playbackTime = AudioSettings.dspTime - startDspTime;
level.UpdateNotes(playbackTime);
PlayerInput input = new PlayerInput();
input.time = playbackTime;
//get laser
var handObjects = player.GetComponent<Valve.VR.InteractionSystem.Player>().hands;
var leftHandObject = handObjects[0];
var rightHandObject = handObjects[1];
var leftLaser = leftHandObject.gameObject.GetComponentInChildren<LineRenderer>();
var rightLaser = rightHandObject.gameObject.GetComponentInChildren<LineRenderer>();
if(leftLaser)
{
var p1 = leftLaser.transform.TransformPoint(leftLaser.GetPosition(0));
var p2 = leftLaser.transform.TransformPoint(leftLaser.GetPosition(1));
input.ray = new Ray(p1, p2-p1);
Debug.DrawRay(input.ray.origin, input.ray.direction, Color.red);
}
level.UpdateNotes(playbackTime);
if (Input.GetKeyDown(KeyCode.Alpha1))
{
input.ray = Camera.main.ScreenPointToRay(Input.mousePosition);
......@@ -98,9 +117,32 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
if (fire.GetStateDown(leftHand))
{
input.hand = HandType.Left;
if (leftLaser)
{
var p1 = leftLaser.transform.TransformPoint(leftLaser.GetPosition(0));
var p2 = leftLaser.transform.TransformPoint(leftLaser.GetPosition(1));
input.ray = new Ray(p1, p2-p1);
Debug.DrawRay(input.ray.origin, input.ray.direction, Color.magenta, 1);
level.HandleInput(input);
}
}
if (fire.GetStateDown(rightHand))
{
input.hand = HandType.Right;
if (rightLaser)
{
var p1 = rightLaser.transform.TransformPoint(rightLaser.GetPosition(0));
var p2 = rightLaser.transform.TransformPoint(rightLaser.GetPosition(1));
input.ray = new Ray(p1, p2 - p1);
Debug.DrawRay(input.ray.origin, input.ray.direction, Color.cyan, 1);
level.HandleInput(input);
}
}
}
catch (NullReferenceException e)
......
......@@ -5,7 +5,7 @@
"app_key": "application.generated.unity.rhythmkata.exe",
"launch_type": "url",
"url": "steam://launch/",
"action_manifest_path": "D:\\git\\RhythmKata\\RhythmKata\\Assets\\StreamingAssets\\SteamVR\\actions.json",
"action_manifest_path": "D:\\Git\\rhythmkata\\RhythmKata\\Assets\\StreamingAssets\\SteamVR\\actions.json",
"strings": {
"en_us": {
"name": "RhythmKata [Testing]"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment