private void AddSceneryToContainer(SceneryTypeEnum sceneryTypeEnum)
    {
        GameObject sceneryObject = sceneryUtil.SpawnNewScenery(sceneryTypeEnum);

        sceneryObject.transform.position = appStateManager.placementCursorPose.position;
        sceneryObject.transform.rotation = appStateManager.placementCursorPose.rotation;

        appStateManager.currentOutputMessage = $"Added Scenery.   Move scenery by tapping directly on it, to select it.   Alternatively, press 'Save' to store the current scenery, or 'Restore' to load a previous save..";
    }
Пример #2
0
    private void RePopulateGameItemsFromData(SceneryItemContainerDTO sceneryItemContainerDTO)
    {
        appStateManager.DestroyAllSceneryInCollection(); // clear out any existing objects

        foreach (SceneryItemDTO sceneryItemData in sceneryItemContainerDTO.sceneryItems)
        {
            GameObject sceneryObject = sceneryUtil.SpawnNewScenery(sceneryItemData.sceneryTypeEnum);
            SerialiseTransformUtil.UpdateTransform(ref sceneryObject, sceneryItemData.sceneryTransformComponent); // apply the positioning and rotation info, that was saved to the cloud.  note this is the "local" version only, meaning they are relative to the parent (the spatial anchor prefab)
        }
        appStateManager.currentOutputMessage = $"Restored Scenery data from cloud OK.";
    }