Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
renderingEngine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王剑峰
renderingEngine
Commits
3ef630dd
Commit
3ef630dd
authored
Nov 14, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善打包逻辑
parent
8986c628
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
51 deletions
+53
-51
index.js
dist/index.js
+11
-10
index.js.map
dist/index.js.map
+1
-1
Wave.js
examples/scripts/Wave.js
+1
-0
Wave.ts
examples/scripts/Wave.ts
+1
-0
ZoomButton.js
examples/scripts/ZoomButton.js
+22
-25
view-data.js
examples/view-data.js
+5
-5
events.ts
src/zeroing/decorators/events.ts
+5
-3
scripts.ts
src/zeroing/decorators/scripts.ts
+7
-7
No files found.
dist/index.js
View file @
3ef630dd
...
@@ -1915,9 +1915,9 @@
...
@@ -1915,9 +1915,9 @@
script
[
k
]
=
options
[
k
];
script
[
k
]
=
options
[
k
];
}
}
this
.
_scripts
.
push
(
script
);
this
.
_scripts
.
push
(
script
);
script
.
mounted
();
script
.
mounted
&&
script
.
mounted
();
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
script
.
awake
();
script
.
awake
&&
script
.
awake
();
}
}
return
script
;
return
script
;
};
};
...
@@ -1925,9 +1925,9 @@
...
@@ -1925,9 +1925,9 @@
var
script
=
this
.
_scripts
.
splice
(
index
,
1
)[
0
];
var
script
=
this
.
_scripts
.
splice
(
index
,
1
)[
0
];
if
(
script
)
{
if
(
script
)
{
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
script
.
sleep
();
script
.
sleep
&&
script
.
sleep
();
}
}
script
.
destroy
();
script
.
destroy
&&
script
.
destroy
();
}
}
return
script
;
return
script
;
};
};
...
@@ -1945,7 +1945,7 @@
...
@@ -1945,7 +1945,7 @@
for
(
var
_i
=
0
,
_a
=
this
.
_scripts
;
_i
<
_a
.
length
;
_i
++
)
{
for
(
var
_i
=
0
,
_a
=
this
.
_scripts
;
_i
<
_a
.
length
;
_i
++
)
{
var
script
=
_a
[
_i
];
var
script
=
_a
[
_i
];
if
(
!
script
.
disabled
)
{
if
(
!
script
.
disabled
)
{
script
.
awake
();
script
.
awake
&&
script
.
awake
();
}
}
}
}
};
};
...
@@ -1953,7 +1953,7 @@
...
@@ -1953,7 +1953,7 @@
for
(
var
_i
=
0
,
_a
=
this
.
_scripts
;
_i
<
_a
.
length
;
_i
++
)
{
for
(
var
_i
=
0
,
_a
=
this
.
_scripts
;
_i
<
_a
.
length
;
_i
++
)
{
var
script
=
_a
[
_i
];
var
script
=
_a
[
_i
];
if
(
!
script
.
disabled
)
{
if
(
!
script
.
disabled
)
{
script
.
sleep
();
script
.
sleep
&&
script
.
sleep
();
}
}
}
}
};
};
...
@@ -1962,7 +1962,7 @@
...
@@ -1962,7 +1962,7 @@
for
(
var
_i
=
0
,
_a
=
this
.
_scripts
;
_i
<
_a
.
length
;
_i
++
)
{
for
(
var
_i
=
0
,
_a
=
this
.
_scripts
;
_i
<
_a
.
length
;
_i
++
)
{
var
script
=
_a
[
_i
];
var
script
=
_a
[
_i
];
if
(
!
script
.
disabled
)
{
if
(
!
script
.
disabled
)
{
script
.
update
(
t
);
script
.
update
&&
script
.
update
(
t
);
}
}
}
}
};
};
...
@@ -2301,6 +2301,7 @@
...
@@ -2301,6 +2301,7 @@
for
(
var
k
in
eventsMapping
)
{
for
(
var
k
in
eventsMapping
)
{
this
.
addEventListener
(
k
,
eventsProxy
.
onEvent
,
eventsProxy
);
this
.
addEventListener
(
k
,
eventsProxy
.
onEvent
,
eventsProxy
);
}
}
eventsProxy
.
invoke
(
'init'
,
this
);
};
};
}
}
var
EventsProxy
=
(
function
(
_super
)
{
var
EventsProxy
=
(
function
(
_super
)
{
...
@@ -2308,20 +2309,20 @@
...
@@ -2308,20 +2309,20 @@
function
EventsProxy
()
{
function
EventsProxy
()
{
return
_super
.
call
(
this
)
||
this
;
return
_super
.
call
(
this
)
||
this
;
}
}
EventsProxy
.
prototype
.
invoke
=
function
(
name
,
e
)
{
EventsProxy
.
prototype
.
invoke
=
function
(
name
,
target
)
{
if
(
this
.
eventsConfig
)
{
if
(
this
.
eventsConfig
)
{
var
eventConfig
=
this
.
eventsConfig
[
name
];
var
eventConfig
=
this
.
eventsConfig
[
name
];
if
(
eventConfig
)
{
if
(
eventConfig
)
{
executeBehavior
({
executeBehavior
({
main
:
eventConfig
.
behaviors
[
0
],
main
:
eventConfig
.
behaviors
[
0
],
},
'main'
,
e
.
target
);
},
'main'
,
target
);
}
}
}
}
};
};
EventsProxy
.
prototype
.
onEvent
=
function
(
e
)
{
EventsProxy
.
prototype
.
onEvent
=
function
(
e
)
{
var
eventName
=
eventsMapping
[
e
.
type
];
var
eventName
=
eventsMapping
[
e
.
type
];
if
(
eventName
)
{
if
(
eventName
)
{
this
.
invoke
(
eventName
,
e
);
this
.
invoke
(
eventName
,
e
.
target
);
}
}
};
};
EventsProxy
.
prototype
.
destroy
=
function
()
{
EventsProxy
.
prototype
.
destroy
=
function
()
{
...
...
dist/index.js.map
View file @
3ef630dd
This diff is collapsed.
Click to expand it.
examples/scripts/Wave.js
View file @
3ef630dd
...
@@ -20,6 +20,7 @@ var Wave = (function () {
...
@@ -20,6 +20,7 @@ var Wave = (function () {
Wave
.
prototype
.
sleep
=
function
()
{
Wave
.
prototype
.
sleep
=
function
()
{
console
.
log
(
'sleep'
);
console
.
log
(
'sleep'
);
};
};
Wave
.
id
=
'wave'
;
return
Wave
;
return
Wave
;
}());
}());
exports
[
"default"
]
=
Wave
;
exports
[
"default"
]
=
Wave
;
examples/scripts/Wave.ts
View file @
3ef630dd
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
*/
*/
export
default
class
Wave
{
export
default
class
Wave
{
static
id
=
'wave'
;
host
;
host
;
duration
;
duration
;
...
...
examples/scripts/ZoomButton.js
View file @
3ef630dd
/**
"use strict"
;
* Created by rockyl on 2019-11-07.
exports
.
__esModule
=
true
;
*/
var
ZoomButton
=
(
function
()
{
function
ZoomButton
()
{
class
ZoomButton
{
this
.
zoomTo
=
1.1
;
static
name
=
'ZoomButton'
;
}
ZoomButton
.
prototype
.
mounted
=
function
()
{
zoomTo
=
1.1
;
this
.
host
.
anchorX
=
this
.
host
.
width
/
2
;
this
.
host
.
anchorY
=
this
.
host
.
height
/
2
;
mounted
()
{
this
.
host
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
this
.
_onMouseDown
,
this
);
this
.
host
.
anchorX
=
this
.
host
.
width
/
2
;
this
.
host
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
_onMouseUp
,
this
);
this
.
host
.
anchorY
=
this
.
host
.
height
/
2
;
};
ZoomButton
.
prototype
.
_onMouseDown
=
function
(
e
)
{
this
.
host
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
this
.
_onMouseDown
,
this
);
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
this
.
zoomTo
;
this
.
host
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
_onMouseUp
,
this
);
};
}
ZoomButton
.
prototype
.
_onMouseUp
=
function
(
e
)
{
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
1
;
_onMouseDown
(
e
)
{
};
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
this
.
zoomTo
;
ZoomButton
.
id
=
'zoom-button'
;
}
return
ZoomButton
;
}());
_onMouseUp
(
e
)
{
exports
[
"default"
]
=
ZoomButton
;
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
1
;
}
}
examples/view-data.js
View file @
3ef630dd
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
const
data
=
{
const
data
=
{
launchO
ptions
:
{
o
ptions
:
{
entrySceneView
:
'view1'
,
entrySceneView
:
'view1'
,
containerID
:
'game-container'
,
containerID
:
'game-container'
,
designWidth
:
750
,
designWidth
:
750
,
...
@@ -430,15 +430,15 @@ let func = new Function('return '+leftValue+args.operator+rightValue);
...
@@ -430,15 +430,15 @@ let func = new Function('return '+leftValue+args.operator+rightValue);
let result = func();
let result = func();
resolve({type: result ? 'equal' : 'unequal'});
resolve({type: result ? 'equal' : 'unequal'});
`
,
`
,
output
:
[
'
complete
'
],
output
:
[
'
equal'
,
'unequal
'
],
},
},
{
{
id
:
'nestProc'
,
id
:
'nestProc'
,
name
:
'NestProc'
,
name
:
'NestProc'
,
metas
:
{
metas
:
{
print
:
{
print
:
{
id
:
'
print
'
,
id
:
'
log
'
,
name
:
'
Print
'
,
name
:
'
Log
'
,
props
:
{
props
:
{
text
:
{
type
:
'string'
,
default
:
''
},
text
:
{
type
:
'string'
,
default
:
''
},
},
},
...
@@ -461,7 +461,7 @@ resolve({type: result ? 'equal' : 'unequal'});
...
@@ -461,7 +461,7 @@ resolve({type: result ? 'equal' : 'unequal'});
2
:
{
2
:
{
uuid
:
'2'
,
uuid
:
'2'
,
alias
:
'打印'
,
alias
:
'打印'
,
meta
:
'
print
'
,
meta
:
'
log
'
,
props
:
{
props
:
{
text
:
'hello'
,
text
:
'hello'
,
},
},
...
...
src/zeroing/decorators/events.ts
View file @
3ef630dd
...
@@ -26,6 +26,8 @@ export function applyEvents(ctor: Function) {
...
@@ -26,6 +26,8 @@ export function applyEvents(ctor: Function) {
for
(
let
k
in
eventsMapping
)
{
for
(
let
k
in
eventsMapping
)
{
this
.
addEventListener
(
k
,
eventsProxy
.
onEvent
,
eventsProxy
);
this
.
addEventListener
(
k
,
eventsProxy
.
onEvent
,
eventsProxy
);
}
}
eventsProxy
.
invoke
(
'init'
,
this
);
};
};
}
}
...
@@ -36,13 +38,13 @@ class EventsProxy extends HashObject {
...
@@ -36,13 +38,13 @@ class EventsProxy extends HashObject {
super
();
super
();
}
}
invoke
(
name
,
e
)
{
invoke
(
name
,
target
)
{
if
(
this
.
eventsConfig
)
{
if
(
this
.
eventsConfig
)
{
const
eventConfig
=
this
.
eventsConfig
[
name
];
const
eventConfig
=
this
.
eventsConfig
[
name
];
if
(
eventConfig
)
{
if
(
eventConfig
)
{
executeBehavior
({
executeBehavior
({
main
:
eventConfig
.
behaviors
[
0
],
main
:
eventConfig
.
behaviors
[
0
],
},
'main'
,
e
.
target
);
},
'main'
,
target
);
}
}
}
}
}
}
...
@@ -50,7 +52,7 @@ class EventsProxy extends HashObject {
...
@@ -50,7 +52,7 @@ class EventsProxy extends HashObject {
onEvent
(
e
)
{
onEvent
(
e
)
{
let
eventName
=
eventsMapping
[
e
.
type
];
let
eventName
=
eventsMapping
[
e
.
type
];
if
(
eventName
)
{
if
(
eventName
)
{
this
.
invoke
(
eventName
,
e
);
this
.
invoke
(
eventName
,
e
.
target
);
}
}
}
}
...
...
src/zeroing/decorators/scripts.ts
View file @
3ef630dd
...
@@ -113,9 +113,9 @@ class ScriptsProxy {
...
@@ -113,9 +113,9 @@ class ScriptsProxy {
}
}
this
.
_scripts
.
push
(
script
);
this
.
_scripts
.
push
(
script
);
script
.
mounted
();
script
.
mounted
&&
script
.
mounted
();
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
script
.
awake
();
script
.
awake
&&
script
.
awake
();
}
}
return
script
;
return
script
;
...
@@ -129,9 +129,9 @@ class ScriptsProxy {
...
@@ -129,9 +129,9 @@ class ScriptsProxy {
let
script
=
this
.
_scripts
.
splice
(
index
,
1
)[
0
];
let
script
=
this
.
_scripts
.
splice
(
index
,
1
)[
0
];
if
(
script
)
{
if
(
script
)
{
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
script
.
sleep
();
script
.
sleep
&&
script
.
sleep
();
}
}
script
.
destroy
();
script
.
destroy
&&
script
.
destroy
();
}
}
return
script
;
return
script
;
}
}
...
@@ -157,7 +157,7 @@ class ScriptsProxy {
...
@@ -157,7 +157,7 @@ class ScriptsProxy {
onAddedToStage
()
{
onAddedToStage
()
{
for
(
let
script
of
this
.
_scripts
)
{
for
(
let
script
of
this
.
_scripts
)
{
if
(
!
script
.
disabled
)
{
if
(
!
script
.
disabled
)
{
script
.
awake
();
script
.
awake
&&
script
.
awake
();
}
}
}
}
}
}
...
@@ -168,7 +168,7 @@ class ScriptsProxy {
...
@@ -168,7 +168,7 @@ class ScriptsProxy {
onRemovedFromStage
()
{
onRemovedFromStage
()
{
for
(
let
script
of
this
.
_scripts
)
{
for
(
let
script
of
this
.
_scripts
)
{
if
(
!
script
.
disabled
)
{
if
(
!
script
.
disabled
)
{
script
.
sleep
();
script
.
sleep
&&
script
.
sleep
();
}
}
}
}
}
}
...
@@ -180,7 +180,7 @@ class ScriptsProxy {
...
@@ -180,7 +180,7 @@ class ScriptsProxy {
let
t
=
e
.
data
;
let
t
=
e
.
data
;
for
(
let
script
of
this
.
_scripts
)
{
for
(
let
script
of
this
.
_scripts
)
{
if
(
!
script
.
disabled
)
{
if
(
!
script
.
disabled
)
{
script
.
update
(
t
);
script
.
update
&&
script
.
update
(
t
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment