私はUnity 5 WebGLプロジェクトでSCORM 1.2を動作させようとしています。SCORM.jsをUnity 5で動作させるために変換する
私は徐々にSCORMコードを導入すると思いました。
var vault = {}; //vault 'namespace' helps ensure no conflicts with possible other "SCORM" variables
vault.UTILS = {}; //For holding UTILS functions
vault.debug = { isActive: true }; //Enable (true) or disable (false) for debug mode
vault.SCORM = { //Define the SCORM object
version: null, //Store SCORM version.
handleCompletionStatus: true, //Whether or not the wrapper should automatically handle the initial completion status
handleExitMode: true, //Whether or not the wrapper should automatically handle the exit mode
API:{handle: null, isFound: false}, //Create API child object
connection: { isActive: false }, //Create connection child object
data: { completionStatus: null, exitStatus: null}, //Create data child object
debug:{} //Create debug child object
};
私はそのコードを使用
、そのまま、私はUnityが'Utils' is not a member of 'Boo.Lang.Hash'
OKと言われています:ここで私はそれがユニティで動作するように、「翻訳」したいコードです。私は、私はハッシュテーブルを使ってはいけないと言われました。だからここに私がこれまで持っているものです:
var vault:Hashtable = new Hashtable(); //vault 'namespace' helps ensure no conflicts with possible other "SCORM" variables
vault['UTILS'] = new Hashtable(); //For holding UTILS functions
vault['debug'] = new Hashtable(); //Enable (true) or disable (false) for debug mode
vault['debug']['isActive'] = true;
vault['SCORM'] = { //Define the SCORM object
version: null, //Store SCORM version.
handleCompletionStatus: true, //Whether or not the wrapper should automatically handle the initial completion status
handleExitMode: true, //Whether or not the wrapper should automatically handle the exit mode
API:{handle: null, isFound: false}, //Create API child object
connection: { isActive: false }, //Create connection child object
data: { completionStatus: null, exitStatus: null}, //Create data child object
debug:{} //Create debug child object
};
をしかし、今Unityは、次のエラーがスローされます。
Type 'Object' does not support slicing
.... vault['debug']['isActive'] = true;
ラインで。
So - 変数にネストされたHashtableにプロパティを追加するにはどうすればよいですか?
ユニティの「JavaScript」は実際にはJavaScriptではありません。それは実際にUnityの修正された.NET CLR上で実行されるBooへのクロスコンパイルです。 SCORMをUnityで動かそうとすることは非常に難しくなります。ブラウザ上でSCORMとUnityを別々に実行し、APIを介して通信する方が簡単かもしれません。 – rutter
このページ:https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html非常に有益ですが、私は 'EntryPointNotFoundException'エラーが発生しています。研究は続きます... – moosefetcher
私はUnityで動作しませんが、ライブラリがSCORM.jsという名前ではなく、あなたの会社の誰かによって名前が変更されたPipwerks SCORM Wrapperです。 https://github.com/pipwerks/scorm-api-wrapper – pipwerks