0

I have integrated SCORM 1.2 with my game which produces WebGL output, if we play the WebGL out directly in browser its working fine and not working in LMS. Found that the game play script included in the game causing the issue, when I disable it and upload the build in LMS its loading (can't proceed with game-play, since script is disabled)

In this script I am using GAF function, Xml data fetching from file placed in StreamingAssets folder, not using any WWW class.

SCORM asset pack included in game, https://www.assetstore.unity3d.com/en/#!/content/53523

Have no idea which function restricting the game from running, could you please have a look on this and send me the feedback.

Error message Please find the attachment.enter image description here

gman
  • 100,619
  • 31
  • 269
  • 393
ben
  • 13
  • 1
  • 7
  • HI, It seems error with file access from streaming assets folder, its not working when uploading in LMS server, how can I rectify that. – ben Aug 27 '16 at 10:51
  • Hi, Access StreamingAssets path folder using WWW class – ben Aug 30 '16 at 05:33

1 Answers1

0

Access StreamingAssets path folder using WWW class https://docs.unity3d.com/ScriptReference/Application-streamingAssetsPath.html

public string filePath = Application.streamingAssetsPath + "/UserDetails.xml";
         public string result = "";
   
   void Awake () 
   { 
   filePath = Application.streamingAssetsPath + "/UserDetails.xml"; 
   }
   
   void Start () 
   { 
   StartCoroutine(userDetailsXmlPath() );
   }
   
         IEnumerator userDetailsXmlPath() 
         {
             print (filePath);
     
             if (filePath.Contains ("://") || filePath.Contains (":///")) {
                 WWW www = new WWW (filePath);
                 yield return www;
                 result = www.text;
     
                 print (result);
                 FetchUserDetails ();
             } else {
                 result = File.ReadAllText (filePath);
     
                 print (result);
                 FetchUserDetails ();
             }
         }
     
         public void FetchUserDetails()
         {
             XmlDocument userXml1 = new XmlDocument ();
     
             userXml1.LoadXml(result);
     
     
             XmlNodeList userList = userXml1.GetElementsByTagName ("user");
     
             foreach(XmlNode userValue in userList)
             {
                 XmlNodeList userContent = userValue.ChildNodes;
                 objUser = new Dictionary<string, string>();
     
                 foreach(XmlNode value in userContent)
                 {
                     objUser.Add (value.Name, value.InnerText);
                 }
     
                 userFullDetails.Add (objUser);
     
                 userCountInXml = userList.Count;
     
                 userId = new string[userList.Count];
                 questionSetOfUser = new string[userList.Count];
             }
     
             AssignUserXmlValuesToArray ();
         }
ben
  • 13
  • 1
  • 7