Ejemplo n.º 1
0
 void Start()
 {
     controller      = GetComponent <Controller2D> ();
     pivot           = GetComponentInChildren <PivotBehaviour> ();
     gravity         = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2);
     maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
     minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight);
 }
Ejemplo n.º 2
0
 void Start()
 {
     controller = GetComponent<Controller2D> ();
     pivot = GetComponentInChildren<PivotBehaviour> ();
     gravity = -(2 * maxJumpHeight) / Mathf.Pow (timeToJumpApex, 2);
     maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
     minJumpVelocity = Mathf.Sqrt (2 * Mathf.Abs (gravity) * minJumpHeight);
 }