示例#1
0
    public virtual void ConfigureJointConstants(JointWrapper wrap)
    {
        var joint = wrap.GetOrMakeJoint <SpringJoint2D>();

        joint.distance              = wrap.GetSource().GetNearbyRadius() + wrap.GetConnected().GetRadius() - .2f;
        joint.frequency             = CellPartBalance.i.springFreq;
        joint.breakForce            = CellPartBalance.i.springBreakForce;
        joint.autoConfigureDistance = false;
        joint.enableCollision       = true;
    }
 public override void OnOwnedJointBroke(JointWrapper joint)
 {
     if (joint.GetConnected() is Membrane m)
     {
         Assert.AreEqual(joint, nextJoint);
         // This is not technically necessary, but it makes this field show
         // up as "null" rather than "missing" while in the editor
         nextJoint = null;
     }
 }
 List <Membrane> GetNexts(int numNext)
 {
     if (nextJoint == null || numNext == 0)
     {
         return(new List <Membrane>());
     }
     else
     {
         Membrane        n = nextJoint.GetConnected() as Membrane;
         List <Membrane> l = n.GetNexts(numNext - 1);
         l.Add(n);
         return(l);
     }
 }