Commit c79c553d authored by 15박보승's avatar 15박보승

ForwardNote 움직임 변경

parent 07054fb5
......@@ -48,7 +48,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FrontTex:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: d6f0e028c1244404eb2d02959b9f8f60, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LeftTex:
......
......@@ -205,6 +205,48 @@ MonoBehaviour:
- {fileID: 8300000, guid: c2f12704acf658247b2140ac0cf42ba5, type: 3}
- {fileID: 8300000, guid: 555197e3a8315ad44844278d16b1e3fb, type: 3}
ring: {fileID: 0}
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -0.006500244
inSlope: 5.2741838
outSlope: 5.2741838
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0.074386515
- serializedVersion: 3
time: 0.75
value: 2
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.096423134
outWeight: 1
- serializedVersion: 3
time: 1
value: 1
inSlope: -4.2210984
outSlope: -4.2210984
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.13715482
- serializedVersion: 3
time: 1.5
value: 0.17175293
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.6662333
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!96 &3626977960969211900
TrailRenderer:
serializedVersion: 2
......
This diff is collapsed.
......@@ -98,7 +98,7 @@ abstract class Note
private static readonly float NOTE_POSITION_MULTIPLIER = 2;
public void Update(float remainingTime)
{
if (remainingTime < NOTE_HIDE_TIMING || remainingTime > NOTE_SHOW_TIMING)
if (remainingTime < NOTE_HIDE_TIMING * NOTE_POSITION_MULTIPLIER || remainingTime > NOTE_SHOW_TIMING)
{
noteObject.gameObject.SetActive(false);
isVisible = false;
......
......@@ -5,24 +5,31 @@ using UnityEngine.UI;
public class ForwardNoteObject : NoteObject
{
public RectTransform ring;
public AnimationCurve curve;
private Material mat;
// 각 노트별 개별 함수이기 때문에 상속 관계 유지 불필요.
public void Init(float x, float y, HandType handType)
{
//Vector3 point = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width * x, Screen.height * y, Camera.main.nearClipPlane));
//
//Vector3 point = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width * x, Screen.height * y, Camera.main.nearClipPlane));
//
perfectZ = IngameUIManager.inst.transform.position.z;
perfectZ = IngameUIManager.inst.transform.position.z;
//Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width * x, Screen.height * y, 0));
//endPoint = ray.GetPoint(perfectZ);
endPoint = new Vector3(-20f + 40 * x, -20.0f + 40 * y, perfectZ);
//Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width * x, Screen.height * y, 0));
//endPoint = ray.GetPoint(perfectZ);
endPoint = new Vector3(-100f + 200 * x, -100.0f + 200 * y, perfectZ);
Ray ray = new Ray(Vector3.zero, endPoint.normalized);
endPoint = ray.GetPoint(perfectZ);
Debug.Log(endPoint);
transform.position = endPoint + new Vector3(0, 0, 15);
ring = IngameUIManager.inst.AddNoteRingUI();
ring.position = endPoint;
ring.LookAt(Vector3.zero);
Material mat = GetComponent<Renderer>().material;
mat = GetComponent<Renderer>().material;
switch (handType)
{
......@@ -38,8 +45,6 @@ public class ForwardNoteObject : NoteObject
GetComponentInChildren<Light>().color = Color.cyan;
ring.GetComponent<Image>().color = Color.cyan;
break;
}
}
private void Start()
......@@ -73,9 +78,15 @@ public class ForwardNoteObject : NoteObject
public override void SetPosition(float remainedTime)
{
base.SetPosition(remainedTime);
//base.SetPosition(remainedTime);
float z = 250 * remainedTime;
//float t = Mathf.Pow(1 - z / 250, 3);
float t = 1 - remainedTime;
transform.position = new Vector3(curve.Evaluate(t) * endPoint.x, curve.Evaluate(t) * endPoint.y, endPoint.z + z);
//transform.position = new Vector3(t * endPoint.x, t * endPoint.y, endPoint.z + z);
var showRing = remainedTime < 0.3f;
var showRing = remainedTime < 0.3f;
ring.localScale = Mathf.Max((1 + 20 * remainedTime), 0) * new Vector3(1, 1, 1);
// change ring alpha
......
......@@ -111,9 +111,9 @@ public abstract class NoteObject : MonoBehaviour
for (float t = 0; t < time; t += Time.deltaTime)
{
//print(t / time);
mat.SetFloat("_Threshold", t / time);
yield return null;
mat.SetColor("_Color", mat.color - new Color(0,0,0,2) * Time.deltaTime);
yield return null;
}
mat.SetFloat("_Threshold", 1);
......
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