コード例 #1
0
 public void RemoveJoint(PlayerLegJoint joint)
 {
     for (int i = 0; i < _jointList.Count; i++)
     {
         if (_jointList[i].joint == joint)
         {
             _jointList.RemoveAt(i);
             break;
         }
     }
 }
コード例 #2
0
    public void AddJoint(PlayerLegJoint joint)
    {
        if (joint == null)
        {
            return;
        }

        Vector2 pos = transform.position;
        var     dir = joint.body.position - pos;
        var     q   = Quaternion.Inverse(transform.rotation);

        dir = q * dir;

        _jointList.Add(new JointParam(dir, joint));
    }
コード例 #3
0
 public JointParam(Vector2 dir, PlayerLegJoint joint)
 {
     this.dir   = dir;
     this.joint = joint;
 }