코인 위치 및 회전 속도

This commit is contained in:
Ino 2025-03-06 15:15:45 +09:00
parent 8110dc549a
commit 05303ab3af
1 changed files with 8 additions and 3 deletions

View File

@ -59,10 +59,15 @@ public class DropItem : ProjectileBase
gameObject.SetActive(true); gameObject.SetActive(true);
m_itemid = itemid; m_itemid = itemid;
m_itemamount = amount; m_itemamount = amount;
Vector3 targetpos = startpos;
switch (m_itemid) switch (m_itemid)
{ {
case 2: startpos += Vector3.up * 0.25f; break; case 2:
startpos += Vector3.up * 0.25f;
targetpos = DSUtil.Get_RandomPos_onNavMesh(startpos, 2f, 3f);
targetpos += Vector3.up * 0.25f;
break;
} }
m_Collider.enabled = false; m_Collider.enabled = false;
@ -84,7 +89,7 @@ public class DropItem : ProjectileBase
// } // }
//} //}
} }
}, startpos, DSUtil.Get_RandomPos_onNavMesh(startpos, 2f, 3f))); }, startpos, targetpos));
StartCoroutine(Co_Rotation_Y()); StartCoroutine(Co_Rotation_Y());
StartCoroutine(Co_Off(20f)); StartCoroutine(Co_Off(20f));
} }
@ -119,7 +124,7 @@ public class DropItem : ProjectileBase
float t = 0f; float t = 0f;
while (true) while (true)
{ {
t += Time.deltaTime * 20f; t += Time.deltaTime * 30f;
t = Mathf.Repeat(t, 359.9f); t = Mathf.Repeat(t, 359.9f);
transform.eulerAngles = new Vector3(0f, t, 0f); transform.eulerAngles = new Vector3(0f, t, 0f);
yield return null; yield return null;