Commit 4b43658f authored by Jérémy Lacoche's avatar Jérémy Lacoche
Browse files

gltf sample can now get gltf from link

parent 5db05740
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -569,7 +569,7 @@ MonoBehaviour:
  m_Script: {fileID: 11500000, guid: f7351c94a4c22144284b9eac3270dc8d, type: 3}
  m_Name: 
  m_EditorClassIdentifier: 
  _PathToGLTF: ARSceneThreeAnchor.glb
  _PathToGLTF: https://www.dropbox.com/scl/fi/yzc04vh687ujgw717r7vm/ARSceneThreeAnchor.glb?rlkey=dm07iorvs0zsdynoh6exl0k4v&st=7d1tqswp&dl=1
  _ValiditySubscription: 10000000
  _DisableObjectWhenNotTracked: 1
--- !u!4 &842320175
+20 −13
Original line number Diff line number Diff line
@@ -85,14 +85,21 @@ public class SceneManagementGLTF : MonoBehaviour
    /// <returns>ascync method</returns>
    protected async Task LoadGltfBinaryFromMemory()
    {
        string filePath = "";
        if (_PathToGLTF.StartsWith("http"))
        {
            KeyValuePair<string, string> download = System.Threading.Tasks.Task.Run(() => WorldAnalysisARFoundationHelper.DownloadFileHTTP(_PathToGLTF)).Result; // synchronous : not perfect at all prevent to add another mesh while bundle is downloading
            filePath = download.Key;
        }
        else
        {
#if UNITY_EDITOR
            string prefix = Application.streamingAssetsPath;
#else
        string prefix = Application.persistentDataPath;
#endif
        var filePath = prefix + "/" + _PathToGLTF;

        Debug.Log("PATH : " + filePath);
            filePath = prefix + "/" + _PathToGLTF;
        }

        byte[] data = File.ReadAllBytes(filePath);
        Debug.Log("File Size " + data.Length);