rev, v0.3
This commit is contained in:
+18
-1
@@ -59,7 +59,7 @@ public class Puck : MonoBehaviour
|
||||
Vector3 worldEnd = Camera.main.ScreenToWorldPoint(new Vector3(GameManager.instance.curPosition.x, GameManager.instance.curPosition.y, Camera.main.nearClipPlane));
|
||||
|
||||
lineEnd = transform.InverseTransformPoint(worldEnd);
|
||||
float clamp = GameManager.instance.puckDragClamp;
|
||||
float clamp = GameManager.instance.puckDragClampMax;
|
||||
lineEnd = Vector2.ClampMagnitude(lineEnd, clamp);
|
||||
|
||||
// Only two points for the line
|
||||
@@ -105,6 +105,23 @@ public class Puck : MonoBehaviour
|
||||
{
|
||||
StartCoroutine(CoroutineReset(duration));
|
||||
}
|
||||
Coroutine coroutineScheduleReset;
|
||||
public void ScheduleReset(float duration = 0.5f){
|
||||
coroutineScheduleReset = StartCoroutine(CoroutineScheduleReset(duration));
|
||||
}
|
||||
|
||||
public void UnscheduleReset(){
|
||||
if(coroutineScheduleReset != null){
|
||||
StopCoroutine(coroutineScheduleReset);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator CoroutineScheduleReset(float duration){
|
||||
while(GameManager.isMoving){
|
||||
yield return null;
|
||||
}
|
||||
Reset(duration);
|
||||
}
|
||||
|
||||
IEnumerator CoroutineReset(float duration){
|
||||
float t=0;
|
||||
|
||||
Reference in New Issue
Block a user