Beispiel #1
0
 protected void UpdateTransform()
 {
     // The object was moved locally, so reset the target positions to the current position
     Position.Reset(transform.localPosition);
     Rotation.Reset(transform.localRotation);
     Scale.Reset(transform.localScale);
 }
Beispiel #2
0
        private void LateUpdate()
        {
            // Determine if the transform has changed locally, in which case we need to update the data model
            if (transform.localPosition != Position.Value ||
                Quaternion.Angle(transform.localRotation, Rotation.Value) > 0.2f ||
                transform.localScale != Scale.Value)
            {
                transformDataModel.Position.Value = transform.localPosition;
                transformDataModel.Rotation.Value = transform.localRotation;
                transformDataModel.Scale.Value    = transform.localScale;

                // The object was moved locally, so reset the target positions to the current position
                Position.Reset(transform.localPosition);
                Rotation.Reset(transform.localRotation);
                Scale.Reset(transform.localScale);
            }
        }