コード例 #1
0
    void UpdateRenderingModeRecursive(Transform target, BlendMode blendMode)
    {
        foreach (Transform child in target)
        {
            UpdateRenderingModeRecursive(child, blendMode);
        }

        Renderer renderer = target.GetComponent <Renderer>();

        if (renderer != null)
        {
            foreach (Material m in renderer.materials)
            {
                if (m.shader.name == "Standard")
                {
                    UtilitiesCR.ChangeRenderMode(m, blendMode);
                }
            }
        }
    }
コード例 #2
0
    void LoadWorldMap()
    {
        Debug.LogFormat("Loading ARWorldMap {0}", WorldMapPath);
        var worldMap = ARWorldMap.Load(WorldMapPath);

        if (worldMap != null)
        {
            Debug.LogFormat("Map loaded. Center: {0} Extent: {1}", worldMap.center, worldMap.extent);

            var config = ARKitCameraManager.Instance.sessionConfiguration;
            config.worldMap = worldMap;
            UnityARSessionRunOption runOption = UnityARSessionRunOption.ARSessionRunOptionRemoveExistingAnchors | UnityARSessionRunOption.ARSessionRunOptionResetTracking;

            Debug.Log("Restarting session with worldMap");
            Session.RunWithConfigAndOptions(config, runOption);

            referenceImage.GetComponent <Image>().sprite = UtilitiesCR.LoadNewSprite(ReferenceImagePath);
            referenceImage.SetActive(true);
        }
    }