Example #1
0
 public virtual void SetUpdateData(LoadParcelScenesMessage.UnityParcelScene data)
 {
     contentProvider          = new ContentProvider();
     contentProvider.baseUrl  = data.baseUrl;
     contentProvider.contents = data.contents;
     contentProvider.BakeHashes();
 }
Example #2
0
        public override void SetData(LoadParcelScenesMessage.UnityParcelScene data)
        {
            this.sceneData = data;

            contentProvider          = new ContentProvider();
            contentProvider.baseUrl  = data.baseUrl;
            contentProvider.contents = data.contents;
            contentProvider.BakeHashes();

            if (DCLCharacterController.i != null)
            {
                gameObject.transform.position = PositionUtils.WorldToUnityPosition(Utils.GridToWorldPosition(data.basePosition.x, data.basePosition.y));
            }
        }
Example #3
0
    ContentProvider CreateContentProviderForSceneObject(SceneObject sceneObject)
    {
        ContentProvider contentProvider = new ContentProvider();

        contentProvider.baseUrl = BuilderInWorldSettings.BASE_URL_CATALOG;
        foreach (KeyValuePair <string, string> content in sceneObject.contents)
        {
            ContentServerUtils.MappingPair mappingPair = new ContentServerUtils.MappingPair();
            mappingPair.file = content.Key;
            mappingPair.hash = content.Value;
            contentProvider.contents.Add(mappingPair);
        }

        contentProvider.BakeHashes();
        return(contentProvider);
    }
Example #4
0
    ContentProvider CreateContentProviderForSceneObject(SceneObject sceneObject)
    {
        ContentProvider contentProvider = new ContentProvider();

        contentProvider.baseUrl = BIWUrlUtils.GetUrlSceneObjectContent();
        foreach (KeyValuePair <string, string> content in sceneObject.contents)
        {
            ContentServerUtils.MappingPair mappingPair = new ContentServerUtils.MappingPair();
            mappingPair.file = content.Key;
            mappingPair.hash = content.Value;
            contentProvider.contents.Add(mappingPair);
        }

        contentProvider.BakeHashes();
        return(contentProvider);
    }
Example #5
0
        public virtual void SetData(LoadParcelScenesMessage.UnityParcelScene data)
        {
            this.sceneData = data;

            contentProvider          = new ContentProvider();
            contentProvider.baseUrl  = data.baseUrl;
            contentProvider.contents = data.contents;
            contentProvider.BakeHashes();

            state = State.WAITING_FOR_INIT_MESSAGES;
            RefreshName();

            parcels.Clear();
            for (int i = 0; i < sceneData.parcels.Length; i++)
            {
                parcels.Add(sceneData.parcels[i]);
            }

            if (useBlockers)
            {
                blockerHandler = new BlockerHandler();
            }

            if (DCLCharacterController.i != null)
            {
                gameObject.transform.position = DCLCharacterController.i.characterPosition.WorldToUnityPosition(Utils.GridToWorldPosition(data.basePosition.x, data.basePosition.y));
            }

#if UNITY_EDITOR
            //NOTE(Brian): Don't generate parcel blockers if debugScenes is active and is not the desired scene.
            if (SceneController.i.debugScenes && SceneController.i.debugSceneCoords != data.basePosition)
            {
                SetSceneReady();
                return;
            }
#endif
            blockerHandler?.SetupBlockers(parcels, metricsController.GetLimits().sceneHeight, this.transform);

            if (isTestScene)
            {
                SetSceneReady();
            }
        }
Example #6
0
        public virtual void SetData(LoadParcelScenesMessage.UnityParcelScene data)
        {
            this.sceneData = data;

            contentProvider          = new ContentProvider();
            contentProvider.baseUrl  = data.baseUrl;
            contentProvider.contents = data.contents;
            contentProvider.BakeHashes();

            parcels.Clear();
            for (int i = 0; i < sceneData.parcels.Length; i++)
            {
                parcels.Add(sceneData.parcels[i]);
            }

            if (DCLCharacterController.i != null)
            {
                gameObject.transform.position = PositionUtils.WorldToUnityPosition(Utils.GridToWorldPosition(data.basePosition.x, data.basePosition.y));
            }

            OnSetData?.Invoke(data);
        }