Пример #1
0
 public override void EnsureInitialized()
 {
     if (!initialized)
     {
         initialized            = true;
         jointA.useLimits       = (jointB.useLimits = useLimits);
         jointA.minValue        = (jointB.minValue = minValue / 2f);
         jointA.maxValue        = (jointB.maxValue = maxValue / 2f);
         jointA.maxSpeed        = (jointB.maxSpeed = maxSpeed / 2f);
         jointA.maxAcceleration = (jointB.maxAcceleration = maxAcceleration / 2f);
         jointA.useSpring       = (jointB.useSpring = useSpring);
         jointA.tensionDist     = (jointB.tensionDist = tensionDist / 2f);
         jointA.maxForce        = (jointB.maxForce = maxForce / 2f);
         jointA.EnsureInitialized();
         jointB.EnsureInitialized();
         _isKinematic = jointA.isKinematic;
         if (maxValue == 1.7f)
         {
             GameObject gameObject = new GameObject("JamDoorAchievement");
             gameObject.transform.SetParent(base.transform, worldPositionStays: false);
             gameObject.transform.localPosition = new Vector3(0f, 1f, -1f);
             gameObject.transform.localRotation = Quaternion.Euler(90f, 0f, 0f);
             gameObject.gameObject.AddComponent <JamDoorAchievement>().door = this;
             BoxCollider boxCollider = gameObject.gameObject.AddComponent <BoxCollider>();
             boxCollider.isTrigger = true;
             boxCollider.center    = new Vector3(0.25f, 1f, 0f);
             boxCollider.size      = new Vector3(1f, 2f, 2f);
             gameObject.layer      = 15;
         }
     }
 }
Пример #2
0
 private void Awake()
 {
     if (showDebug)
     {
         Debug.Log(base.name + " Awake ");
     }
     if (joint == null)
     {
         joint = GetComponent <JointBase>();
     }
     if (joint != null)
     {
         joint.EnsureInitialized();
         maxForce = joint.maxForce;
     }
     else if (showDebug)
     {
         Debug.Log(base.name + " There is nothing set within the joint var ");
     }
 }