Skip to content

Commit e8dbeeb

Browse files
oops! Unity WebGL not support moblie browsers!
1 parent bd9276a commit e8dbeeb

File tree

16 files changed

+258
-2
lines changed

16 files changed

+258
-2
lines changed

MyFirstUnity/Assets/Scripts/KeyMove.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ void Update () {
1212
//現在の回転量を取得する
1313
var currentRotation = this.transform.rotation;
1414

15-
//左右の回転軸(左右矢印キーで動く)の値を取得する
15+
//上下左右の回転軸(左右矢印キーで動く)の値を取得する
1616
//Quarternionは掛け算をすると回転量が変わる
17-
var nextRotation = currentRotation * Quaternion.AngleAxis(Input.GetAxis("Horizontal"), Vector3.forward);
17+
var horizontalRotation = Quaternion.AngleAxis(Input.GetAxis("Horizontal"), Vector3.forward);
18+
var verticalRotation = Quaternion.AngleAxis(Input.GetAxis("Vertical"), Vector3.right);
19+
20+
var nextRotation = currentRotation * horizontalRotation * verticalRotation;
1821

1922
//計算後の回転量を設定する
2023
this.transform.rotation = nextRotation;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Options +FollowSymLinks
2+
RewriteEngine on
3+
4+
RewriteCond %{HTTP:Accept-encoding} gzip
5+
RewriteCond %{REQUEST_FILENAME}gz -f
6+
RewriteRule ^(.*)\.js$ $1\.jsgz [L]
7+
8+
RewriteCond %{HTTP:Accept-encoding} gzip
9+
RewriteCond %{REQUEST_FILENAME}gz -f
10+
RewriteRule ^(.*)\.data$ $1\.datagz [L]
11+
12+
RewriteCond %{HTTP:Accept-encoding} gzip
13+
RewriteCond %{REQUEST_FILENAME}gz -f
14+
RewriteRule ^(.*)\.mem$ $1\.memgz [L]
15+
16+
RewriteCond %{HTTP:Accept-encoding} gzip
17+
RewriteCond %{REQUEST_FILENAME}gz -f
18+
RewriteRule ^(.*)\.unity3d$ $1\.unity3dgz [L]
19+
20+
AddEncoding gzip .jsgz
21+
AddEncoding gzip .datagz
22+
AddEncoding gzip .memgz
23+
AddEncoding gzip .unity3dgz

MyFirstUnity/WebGL/Release/UnityLoader.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
624 KB
Binary file not shown.
3.48 MB
Binary file not shown.
237 KB
Binary file not shown.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
function UnityProgress (dom) {
2+
this.progress = 0.0;
3+
this.message = "";
4+
this.dom = dom;
5+
6+
var parent = dom.parentNode;
7+
8+
var background = document.createElement("div");
9+
background.style.background = "#4D4D4D";
10+
background.style.position = "absolute";
11+
parent.appendChild(background);
12+
this.background = background;
13+
14+
var logoImage = document.createElement("img");
15+
logoImage.src = "TemplateData/progresslogo.png";
16+
logoImage.style.position = "absolute";
17+
parent.appendChild(logoImage);
18+
this.logoImage = logoImage;
19+
20+
var progressFrame = document.createElement("img");
21+
progressFrame.src = "TemplateData/loadingbar.png";
22+
progressFrame.style.position = "absolute";
23+
parent.appendChild(progressFrame);
24+
this.progressFrame = progressFrame;
25+
26+
var progressBar = document.createElement("img");
27+
progressBar.src = "TemplateData/fullbar.png";
28+
progressBar.style.position = "absolute";
29+
parent.appendChild(progressBar);
30+
this.progressBar = progressBar;
31+
32+
var messageArea = document.createElement("p");
33+
messageArea.style.position = "absolute";
34+
parent.appendChild(messageArea);
35+
this.messageArea = messageArea;
36+
37+
38+
this.SetProgress = function (progress) {
39+
if (this.progress < progress)
40+
this.progress = progress;
41+
this.messageArea.style.display = "none";
42+
this.progressFrame.style.display = "inline";
43+
this.progressBar.style.display = "inline";
44+
this.Update();
45+
}
46+
47+
this.SetMessage = function (message) {
48+
this.message = message;
49+
this.background.style.display = "inline";
50+
this.logoImage.style.display = "inline";
51+
this.progressFrame.style.display = "none";
52+
this.progressBar.style.display = "none";
53+
this.Update();
54+
}
55+
56+
this.Clear = function() {
57+
this.background.style.display = "none";
58+
this.logoImage.style.display = "none";
59+
this.progressFrame.style.display = "none";
60+
this.progressBar.style.display = "none";
61+
}
62+
63+
this.Update = function() {
64+
this.background.style.top = this.dom.offsetTop + 'px';
65+
this.background.style.left = this.dom.offsetLeft + 'px';
66+
this.background.style.width = this.dom.offsetWidth + 'px';
67+
this.background.style.height = this.dom.offsetHeight + 'px';
68+
69+
var logoImg = new Image();
70+
logoImg.src = this.logoImage.src;
71+
var progressFrameImg = new Image();
72+
progressFrameImg.src = this.progressFrame.src;
73+
74+
this.logoImage.style.top = this.dom.offsetTop + (this.dom.offsetHeight * 0.5 - logoImg.height * 0.5) + 'px';
75+
this.logoImage.style.left = this.dom.offsetLeft + (this.dom.offsetWidth * 0.5 - logoImg.width * 0.5) + 'px';
76+
this.logoImage.style.width = logoImg.width+'px';
77+
this.logoImage.style.height = logoImg.height+'px';
78+
79+
this.progressFrame.style.top = this.dom.offsetTop + (this.dom.offsetHeight * 0.5 + logoImg.height * 0.5 + 10) + 'px';
80+
this.progressFrame.style.left = this.dom.offsetLeft + (this.dom.offsetWidth * 0.5 - progressFrameImg.width * 0.5) + 'px';
81+
this.progressFrame.width = progressFrameImg.width;
82+
this.progressFrame.height = progressFrameImg.height;
83+
84+
this.progressBar.style.top = this.progressFrame.style.top;
85+
this.progressBar.style.left = this.progressFrame.style.left;
86+
this.progressBar.width = progressFrameImg.width * Math.min(this.progress, 1);
87+
this.progressBar.height = progressFrameImg.height;
88+
89+
this.messageArea.style.top = this.progressFrame.style.top;
90+
this.messageArea.style.left = 0;
91+
this.messageArea.style.width = '100%';
92+
this.messageArea.style.textAlign = 'center';
93+
this.messageArea.innerHTML = this.message;
94+
}
95+
96+
this.Update ();
97+
}
16.3 KB
Binary file not shown.
2.73 KB
Loading
15.3 KB
Loading

0 commit comments

Comments
 (0)