void IdleState2() { timer -= Time.deltaTime; if (timer <= 0) { mSwordTrapState = SwordTrapState.RiseState; timer = 1.5f; } }
void LowerState() { Vector3 curr = transform.position; curr.y -= riseSpeed * Time.deltaTime; if (curr.y <= -17f) { mSwordTrapState = SwordTrapState.IdleState2; } else { transform.position = curr; } }
void RiseState() { Vector3 curr = transform.position; curr.y += riseSpeed * Time.deltaTime; if (curr.y >= -14.2) { mSwordTrapState = SwordTrapState.IdleState; } else { transform.position = curr; } }