Esempio n. 1
0
 //TODO(ihsoft): It's too expensive to call it for every item.
 public void Update()
 {
     if (equippedGameObj != null)
     {
         equippedGameObj.transform.rotation =
             evaTransform.rotation * Quaternion.Euler(prefabModule.equipDir);
         equippedGameObj.transform.position = evaTransform.TransformPoint(prefabModule.equipPos);
     }
     if (prefabModule != null)
     {
         prefabModule.OnItemUpdate(this);
     }
 }
Esempio n. 2
0
 public void Update()
 {
     if (equippedGameObj)
     {
         equippedGameObj.transform.rotation =
             evaTransform.rotation * Quaternion.Euler(prefabModule.equipDir);
         equippedGameObj.transform.position = evaTransform.TransformPoint(prefabModule.equipPos);
         if (equippedPart && equippedPart.Rigidbody)
         {
             equippedPart.Rigidbody.velocity        = equippedPart.vessel.rootPart.Rigidbody.velocity;
             equippedPart.Rigidbody.angularVelocity =
                 equippedPart.vessel.rootPart.Rigidbody.angularVelocity;
         }
     }
     if (prefabModule)
     {
         prefabModule.OnItemUpdate(this);
     }
 }