Created
July 3, 2012 17:31
-
-
Save anchan828/3041253 to your computer and use it in GitHub Desktop.
FileReader使ってローカルのWebPlayer用unity3dファイル読み込む的な
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#gameData :file").change(function (e) { | |
var file = e.target.files[0]; | |
var reader = new FileReader(); | |
reader.onload = function (load) { | |
var uni = load.target.result; | |
uni = uni.replace("data:base64", "data:application/vnd.unity;base64") | |
unityObject.embedUnity("unityPlayer",uni, 600,450); | |
// どっちでもおk | |
// $("#unityPlayer").html('<iframe src="' + uni + '"></iframe>'); | |
} | |
reader.readAsDataURL(file); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment