public void UpdateInfo(BIWEntity entity)
    {
        if (entity != null && entity.rootEntity.gameObject != null)
        {
            Vector3 positionConverted = WorldStateUtils.ConvertUnityToScenePosition(entity.rootEntity.gameObject.transform.position, parcelScene);
            Vector3 currentRotation   = entity.rootEntity.gameObject.transform.rotation.eulerAngles;
            Vector3 currentScale      = entity.rootEntity.gameObject.transform.lossyScale;

            currentRotation = entity.GetEulerRotation();

            entityInformationView.SetPositionAttribute(positionConverted);
            entityInformationView.SetRotationAttribute(currentRotation);
            entityInformationView.SetScaleAttribute(currentScale);
        }
    }
Пример #2
0
    public void UpdateInfo(DCLBuilderInWorldEntity entity)
    {
        if (entity != null && entity.gameObject != null)
        {
            Vector3 positionConverted = WorldStateUtils.ConvertUnityToScenePosition(entity.gameObject.transform.position, parcelScene);
            Vector3 currentRotation   = entity.gameObject.transform.rotation.eulerAngles;
            Vector3 currentScale      = entity.gameObject.transform.localScale;

            var newEuler = currentRotation;

            newEuler.x = RepeatWorking(newEuler.x - currentRotation.x + 180.0F, 360.0F) + currentRotation.x - 180.0F;
            newEuler.y = RepeatWorking(newEuler.y - currentRotation.y + 180.0F, 360.0F) + currentRotation.y - 180.0F;
            newEuler.z = RepeatWorking(newEuler.z - currentRotation.z + 180.0F, 360.0F) + currentRotation.z - 180.0F;

            currentRotation = newEuler;

            entityInformationView.SetPositionAttribute(positionConverted);
            entityInformationView.SetRotationAttribute(currentRotation);
            entityInformationView.SetScaleAttribute(currentScale);
        }
    }