private void Shot() { //Debug.Log("射出冰箭"); GameObject iceArrow = poolManager.GetGameObject(spellName); IceArrow script = iceArrow.GetComponent <IceArrow>(); script.SetThrower(player); Vector2 startDirection = player.transform.position; startDirection.x += movementComponent.IsFacingLeft() ? -1 : 1; script.SetStartPosition(startDirection); script.SetDirection(movementComponent.IsFacingLeft() ? Vector2.left : Vector2.right); }
public override void ReleaseSpell() { GameObject iceArrow = poolManager.GetGameObject(spellName); IceArrow script = iceArrow.GetComponent <IceArrow>(); script.SetThrower(player); Vector2 startDirection = player.transform.position; startDirection.x += movementComponent.IsFacingLeft() ? -1 : 1; script.SetStartPosition(startDirection); script.SetMaxExistTime(0.8f); script.SetDirection(movementComponent.IsFacingLeft() ? Vector2.left : Vector2.right); }