|
|
@@ -107,15 +107,29 @@ public class Bullet : MonoBehaviour
|
|
|
rb.useGravity = false;
|
|
|
rb.velocity = Vector3.zero;
|
|
|
transform.position = myPos;
|
|
|
- attackAni.enabled = false;
|
|
|
+ attackAni.gameObject.SetActive(false);
|
|
|
attackTrigger.gameObject.SetActive(false);
|
|
|
isInVain = true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+
|
|
|
Vector3 velocity = rb.velocity;
|
|
|
velocity.y += extraFallGravity * Time.deltaTime;
|
|
|
+ if(velocity.x > 0.1f)
|
|
|
+ {
|
|
|
+ velocity.x += extraFallGravity * Time.deltaTime;
|
|
|
+ }
|
|
|
+ else if(velocity.x < -0.1f)
|
|
|
+ {
|
|
|
+ velocity.x -= extraFallGravity * Time.deltaTime;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ velocity.x = 0;
|
|
|
+ }
|
|
|
rb.velocity = velocity;
|
|
|
+ attackAni.enabled = false;
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
@@ -214,6 +228,7 @@ public class Bullet : MonoBehaviour
|
|
|
}
|
|
|
if (attackAni)
|
|
|
{
|
|
|
+ attackAni.gameObject.SetActive(true);
|
|
|
attackAni.enabled = true;
|
|
|
}
|
|
|
isInVain = false;
|