コード例 #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);
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: NaoEdoJose/BGwMG
 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);
 }