Skip to content

Commit 33ad8c1

Browse files
committed
update
1 parent efe223b commit 33ad8c1

7 files changed

Lines changed: 35 additions & 12 deletions

File tree

bin/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</head>
1919

2020
<body>
21+
<script src="./require.js"></script>
2122
<!--核心包,封装了显示对象渲染,事件,时间管理,时间轴动画,缓动,消息交互,socket,本地存储,鼠标触摸,声音,加载,颜色滤镜,位图字体等-->
2223
<script type="text/javascript" src="libs/laya.core.js"></script>
2324
<!--封装了webgl渲染管线,如果使用webgl渲染,可以在初始化时调用Laya.init(1000,800,laya.webgl.WebGL);-->
@@ -37,7 +38,10 @@
3738
<!-- 物理引擎matter.js -->
3839
<!--用户自定义顺序文件添加到这里-->
3940
<!--jsfile--Custom-->
40-
<script data-main="js/GameMain" src="./require.js" defer async="true"></script>
41+
<script src="./js/GameMain.js"></script>
42+
<script>
43+
require(['./GameMain'],function(){});
44+
</script>
4145
<!--jsfile--Custom-->
4246
<!--自定义的js(src文件夹下)文件自动添加到下面jsfile模块标签里面里-->
4347
<!--删除标签,ide不会自动添加js文件,请谨慎操作-->

bin/js/Foo.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
define(["require", "exports", "./Laya"], function (require, exports, Laya_1) {
2+
"use strict";
3+
Object.defineProperty(exports, "__esModule", { value: true });
4+
var Foo = (function () {
5+
function Foo() {
6+
var hello = new Laya_1.Text();
7+
hello.text = 'Hello LayaAir';
8+
hello.fontSize = 20;
9+
hello.color = '#ffffff';
10+
Laya.stage.addChild(hello);
11+
}
12+
return Foo;
13+
}());
14+
exports.Foo = Foo;
15+
});

bin/js/GameMain.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
define("adapter", ["require", "exports"], function (require, exports) {
2-
"use strict";
3-
Object.defineProperty(exports, "__esModule", { value: true });
4-
exports.Text = Laya.Text;
5-
});
6-
define("Foo", ["require", "exports", "adapter"], function (require, exports, adapter_1) {
1+
define("Foo", ["require", "exports", "./Laya"], function (require, exports, Laya_1) {
72
"use strict";
83
Object.defineProperty(exports, "__esModule", { value: true });
94
var Foo = (function () {
105
function Foo() {
11-
var hello = new adapter_1.Text();
6+
var hello = new Laya_1.Text();
127
hello.text = 'Hello LayaAir';
138
hello.fontSize = 20;
149
hello.color = '#ffffff';

bin/libs/laya.core.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19575,3 +19575,13 @@ var Laya=window.Laya=(function(window,document){
1957519575
new LayaMain();
1957619576

1957719577
})(window,document,Laya);
19578+
19579+
if (typeof define === "function" && define.amd)
19580+
{
19581+
define('Laya', ["require", "exports"], function (require, exports) {
19582+
"use strict";
19583+
Object.defineProperty(exports, "__esModule", { value: true });
19584+
exports.Text = Laya.Text;
19585+
});
19586+
}
19587+

src/Foo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Text } from './adapter';
1+
import { Text } from './Laya';
22
export class Foo {
33
constructor() {
44
const hello = new Text();

src/adapter.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"module": "amd",
66
"skipLibCheck": true,
77
"outDir": "./bin/js",
8-
"outFile": "./bin/js/GameMain.js",
9-
"watch": true
8+
"outFile": "./bin/js/GameMain.js"//,
9+
// "watch": true
1010
},
1111
"experimentalDecorators": true,
1212
"exclude": [

0 commit comments

Comments
 (0)