Example #1
0
    public void SetEntity(DCLBuilderInWorldEntity entity, ParcelScene currentScene)
    {
        EntityDeselected();
        entityInformationView.SetCurrentEntity(entity);

        if (entityInformationView.currentEntity != null)
        {
            entity.onStatusUpdate -= UpdateEntityName;
            entityInformationView.currentEntity.onStatusUpdate += UpdateEntityName;
        }

        parcelScene = currentScene;

        if (entity.HasSmartItemComponent())
        {
            if (entity.rootEntity.TryGetBaseComponent(CLASS_ID_COMPONENT.SMART_ITEM, out IEntityComponent baseComponent))
            {
                entityInformationView.smartItemList.SetSmartItemParameters(entity.GetSmartItemParameters(), ((SmartItemComponent)baseComponent).GetValues());
            }
        }
        else
        {
            entityInformationView.SetSmartItemListViewActive(false);
        }

        entityInformationView.SetEntityThumbnailEnable(false);
        CatalogItem entitySceneObject = entity.GetCatalogItemAssociated();

        GetThumbnail(entitySceneObject);
        UpdateLimitsInformation(entitySceneObject);
        UpdateEntityName(entityInformationView.currentEntity);
        UpdateInfo(entityInformationView.currentEntity);
    }
    public void SetEntity(DCLBuilderInWorldEntity entity, ParcelScene currentScene)
    {
        EntityDeselected();
        if (currentEntity != null)
        {
            entity.onStatusUpdate -= UpdateEntityName;
        }



        currentEntity = entity;
        currentEntity.onStatusUpdate += UpdateEntityName;

        parcelScene = currentScene;

        if (entity.HasSmartItemComponent())
        {
            if (entity.rootEntity.TryGetBaseComponent(CLASS_ID_COMPONENT.SMART_ITEM, out BaseComponent baseComponent))
            {
                smartItemListView.SetSmartItemParameters(entity.GetSmartItemParameters(), ((SmartItemComponent)baseComponent).model.values);
            }
        }
        else
        {
            smartItemListView.gameObject.SetActive(false);
        }

        entitytTumbailImg.enabled = false;

        CatalogItem entitySceneObject = entity.GetCatalogItemAssociated();

        GetThumbnail(entitySceneObject);

        UpdateLimitsInformation(entitySceneObject);
        UpdateEntityName(currentEntity);
        UpdateInfo(currentEntity);
    }