문제
IEnumerator ApplyItem(ItemData item)
{
switch (item.active.type)
{
case ActiveType.Speed:
CharacterManager.Instance.Player.controller.moveSpeed += item.active.value;
break;
case ActiveType.Invincible:
CharacterManager.Instance.Player.condition.invincible = true;
break;
}
yield return new WaitForSeconds(item.active.duration);
switch (item.active.type)
{
case ActiveType.Speed:
CharacterManager.Instance.Player.controller.moveSpeed -= item.active.value;
break;
case ActiveType.Invincible:
CharacterManager.Instance.Player.condition.invincible = false;
break;
}
}
해결
문제
IEnumerator LaunchCo(Rigidbody rb, Transform player)
{
player.position = transform.position;
rb.isKinematic = true;
player.SetParent(transform);
Quaternion targetRotation = Quaternion.Euler(0, 0, angle);
float elapsedTime = 0f;
while(elapsedTime < 2f)
{
elapsedTime += Time.deltaTime;
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, elapsedTime);
yield return null;
}
yield return new WaitForSeconds(delay);
rb.isKinematic = false;
Vector3 launchDirection = transform.up;
rb.AddForce(launchDirection * launchPower, ForceMode.Impulse);
Debug.Log(rb.velocity);
player.SetParent(null);
}
해결
문제
해결