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
Show 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 @@
script
[
k
]
=
options
[
k
];
}
this
.
_scripts
.
push
(
script
);
script
.
mounted
();
script
.
mounted
&&
script
.
mounted
();
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
script
.
awake
();
script
.
awake
&&
script
.
awake
();
}
return
script
;
};
...
...
@@ -1925,9 +1925,9 @@
var
script
=
this
.
_scripts
.
splice
(
index
,
1
)[
0
];
if
(
script
)
{
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
script
.
sleep
();
script
.
sleep
&&
script
.
sleep
();
}
script
.
destroy
();
script
.
destroy
&&
script
.
destroy
();
}
return
script
;
};
...
...
@@ -1945,7 +1945,7 @@
for
(
var
_i
=
0
,
_a
=
this
.
_scripts
;
_i
<
_a
.
length
;
_i
++
)
{
var
script
=
_a
[
_i
];
if
(
!
script
.
disabled
)
{
script
.
awake
();
script
.
awake
&&
script
.
awake
();
}
}
};
...
...
@@ -1953,7 +1953,7 @@
for
(
var
_i
=
0
,
_a
=
this
.
_scripts
;
_i
<
_a
.
length
;
_i
++
)
{
var
script
=
_a
[
_i
];
if
(
!
script
.
disabled
)
{
script
.
sleep
();
script
.
sleep
&&
script
.
sleep
();
}
}
};
...
...
@@ -1962,7 +1962,7 @@
for
(
var
_i
=
0
,
_a
=
this
.
_scripts
;
_i
<
_a
.
length
;
_i
++
)
{
var
script
=
_a
[
_i
];
if
(
!
script
.
disabled
)
{
script
.
update
(
t
);
script
.
update
&&
script
.
update
(
t
);
}
}
};
...
...
@@ -2301,6 +2301,7 @@
for
(
var
k
in
eventsMapping
)
{
this
.
addEventListener
(
k
,
eventsProxy
.
onEvent
,
eventsProxy
);
}
eventsProxy
.
invoke
(
'init'
,
this
);
};
}
var
EventsProxy
=
(
function
(
_super
)
{
...
...
@@ -2308,20 +2309,20 @@
function
EventsProxy
()
{
return
_super
.
call
(
this
)
||
this
;
}
EventsProxy
.
prototype
.
invoke
=
function
(
name
,
e
)
{
EventsProxy
.
prototype
.
invoke
=
function
(
name
,
target
)
{
if
(
this
.
eventsConfig
)
{
var
eventConfig
=
this
.
eventsConfig
[
name
];
if
(
eventConfig
)
{
executeBehavior
({
main
:
eventConfig
.
behaviors
[
0
],
},
'main'
,
e
.
target
);
},
'main'
,
target
);
}
}
};
EventsProxy
.
prototype
.
onEvent
=
function
(
e
)
{
var
eventName
=
eventsMapping
[
e
.
type
];
if
(
eventName
)
{
this
.
invoke
(
eventName
,
e
);
this
.
invoke
(
eventName
,
e
.
target
);
}
};
EventsProxy
.
prototype
.
destroy
=
function
()
{
...
...
dist/index.js.map
View file @
3ef630dd
This source diff could not be displayed because it is too large. You can
view the blob
instead.
examples/scripts/Wave.js
View file @
3ef630dd
...
...
@@ -20,6 +20,7 @@ var Wave = (function () {
Wave
.
prototype
.
sleep
=
function
()
{
console
.
log
(
'sleep'
);
};
Wave
.
id
=
'wave'
;
return
Wave
;
}());
exports
[
"default"
]
=
Wave
;
examples/scripts/Wave.ts
View file @
3ef630dd
...
...
@@ -3,6 +3,7 @@
*/
export
default
class
Wave
{
static
id
=
'wave'
;
host
;
duration
;
...
...
examples/scripts/ZoomButton.js
View file @
3ef630dd
/**
* Created by rockyl on 2019-11-07.
*/
class
ZoomButton
{
static
name
=
'ZoomButton'
;
zoomTo
=
1.1
;
mounted
()
{
"use strict"
;
exports
.
__esModule
=
true
;
var
ZoomButton
=
(
function
()
{
function
ZoomButton
()
{
this
.
zoomTo
=
1.1
;
}
ZoomButton
.
prototype
.
mounted
=
function
()
{
this
.
host
.
anchorX
=
this
.
host
.
width
/
2
;
this
.
host
.
anchorY
=
this
.
host
.
height
/
2
;
this
.
host
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
this
.
_onMouseDown
,
this
);
this
.
host
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
_onMouseUp
,
this
);
}
_onMouseDown
(
e
)
{
};
ZoomButton
.
prototype
.
_onMouseDown
=
function
(
e
)
{
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
this
.
zoomTo
;
}
_onMouseUp
(
e
)
{
};
ZoomButton
.
prototype
.
_onMouseUp
=
function
(
e
)
{
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
1
;
}
}
};
ZoomButton
.
id
=
'zoom-button'
;
return
ZoomButton
;
}());
exports
[
"default"
]
=
ZoomButton
;
examples/view-data.js
View file @
3ef630dd
...
...
@@ -3,7 +3,7 @@
*/
const
data
=
{
launchO
ptions
:
{
o
ptions
:
{
entrySceneView
:
'view1'
,
containerID
:
'game-container'
,
designWidth
:
750
,
...
...
@@ -430,15 +430,15 @@ let func = new Function('return '+leftValue+args.operator+rightValue);
let result = func();
resolve({type: result ? 'equal' : 'unequal'});
`
,
output
:
[
'
complete
'
],
output
:
[
'
equal'
,
'unequal
'
],
},
{
id
:
'nestProc'
,
name
:
'NestProc'
,
metas
:
{
print
:
{
id
:
'
print
'
,
name
:
'
Print
'
,
id
:
'
log
'
,
name
:
'
Log
'
,
props
:
{
text
:
{
type
:
'string'
,
default
:
''
},
},
...
...
@@ -461,7 +461,7 @@ resolve({type: result ? 'equal' : 'unequal'});
2
:
{
uuid
:
'2'
,
alias
:
'打印'
,
meta
:
'
print
'
,
meta
:
'
log
'
,
props
:
{
text
:
'hello'
,
},
...
...
src/zeroing/decorators/events.ts
View file @
3ef630dd
...
...
@@ -26,6 +26,8 @@ export function applyEvents(ctor: Function) {
for
(
let
k
in
eventsMapping
)
{
this
.
addEventListener
(
k
,
eventsProxy
.
onEvent
,
eventsProxy
);
}
eventsProxy
.
invoke
(
'init'
,
this
);
};
}
...
...
@@ -36,13 +38,13 @@ class EventsProxy extends HashObject {
super
();
}
invoke
(
name
,
e
)
{
invoke
(
name
,
target
)
{
if
(
this
.
eventsConfig
)
{
const
eventConfig
=
this
.
eventsConfig
[
name
];
if
(
eventConfig
)
{
executeBehavior
({
main
:
eventConfig
.
behaviors
[
0
],
},
'main'
,
e
.
target
);
},
'main'
,
target
);
}
}
}
...
...
@@ -50,7 +52,7 @@ class EventsProxy extends HashObject {
onEvent
(
e
)
{
let
eventName
=
eventsMapping
[
e
.
type
];
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 {
}
this
.
_scripts
.
push
(
script
);
script
.
mounted
();
script
.
mounted
&&
script
.
mounted
();
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
script
.
awake
();
script
.
awake
&&
script
.
awake
();
}
return
script
;
...
...
@@ -129,9 +129,9 @@ class ScriptsProxy {
let
script
=
this
.
_scripts
.
splice
(
index
,
1
)[
0
];
if
(
script
)
{
if
(
this
.
_host
&&
this
.
_host
.
stage
)
{
script
.
sleep
();
script
.
sleep
&&
script
.
sleep
();
}
script
.
destroy
();
script
.
destroy
&&
script
.
destroy
();
}
return
script
;
}
...
...
@@ -157,7 +157,7 @@ class ScriptsProxy {
onAddedToStage
()
{
for
(
let
script
of
this
.
_scripts
)
{
if
(
!
script
.
disabled
)
{
script
.
awake
();
script
.
awake
&&
script
.
awake
();
}
}
}
...
...
@@ -168,7 +168,7 @@ class ScriptsProxy {
onRemovedFromStage
()
{
for
(
let
script
of
this
.
_scripts
)
{
if
(
!
script
.
disabled
)
{
script
.
sleep
();
script
.
sleep
&&
script
.
sleep
();
}
}
}
...
...
@@ -180,7 +180,7 @@ class ScriptsProxy {
let
t
=
e
.
data
;
for
(
let
script
of
this
.
_scripts
)
{
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