yeet
This commit is contained in:
@@ -22,8 +22,6 @@ public class TrickController : MonoBehaviour
|
||||
[SerializeField] private TrickController trickPrefab;
|
||||
[SerializeField] private float avoidPlayerRadius = 1.2f;
|
||||
[SerializeField] private float treatSeekWeight = 1f;
|
||||
[SerializeField] private float avoidPlayerWeight = 0.25f;
|
||||
[SerializeField] private float avoidTrickWeight = 0.2f;
|
||||
[SerializeField] private float wanderWeight = 0.4f;
|
||||
[SerializeField] private int maxTricks = 50;
|
||||
[SerializeField] private float jumpImpulse = 6f;
|
||||
@@ -34,6 +32,7 @@ public class TrickController : MonoBehaviour
|
||||
[SerializeField] private float despawnMinX = -12f;
|
||||
[SerializeField] private float despawnMaxX = 12f;
|
||||
[SerializeField] private float despawnMinY = -10f;
|
||||
[SerializeField] private float throwControlLockTime = 0.35f;
|
||||
|
||||
private Rigidbody2D body;
|
||||
private Transform target;
|
||||
@@ -44,6 +43,7 @@ public class TrickController : MonoBehaviour
|
||||
private float nextConsumeTime;
|
||||
private float desiredXVelocity;
|
||||
private float nextJumpTime;
|
||||
private float movementLockUntil;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -121,6 +121,11 @@ public class TrickController : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
if (Time.time < movementLockUntil)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsGrounded())
|
||||
{
|
||||
var airborne = body.linearVelocity;
|
||||
@@ -379,4 +384,9 @@ public class TrickController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnThrown()
|
||||
{
|
||||
movementLockUntil = Time.time + throwControlLockTime;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user