コード例 #1
0
 void Retract()
 {
     if (retracting)
     {
         rb_Component.velocity = Vector3.Normalize(origin - this.transform.position) * retractSpeed;
         if (Vector3.Distance(this.transform.position, origin) <= retractCutoff)
         {
             grapple_Component.HookBreak();
         }
         if (Vector3.Distance(this.transform.position, origin) <= (retractSpeed * Time.fixedDeltaTime))
         {
             grapple_Component.HookBreak();
         }
     }
 }