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
c833d73d
Commit
c833d73d
authored
Nov 20, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分流节点修改为负责最后一个出口
数据中心getDataByName增加容错
parent
8bd346c5
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
35 deletions
+16
-35
TouchZoom.ts
examples/scripts/TouchZoom.ts
+4
-4
ZoomButton.js
examples/scripts/ZoomButton.js
+0
-22
Process.ts
src/zeroing/behavior-runtime/Process.ts
+3
-3
scripts.ts
src/zeroing/decorators/scripts.ts
+5
-5
data-center.ts
src/zeroing/game-warpper/data-center.ts
+3
-1
index.ts
src/zeroing/index.ts
+1
-0
No files found.
examples/scripts/
ZoomButton
.ts
→
examples/scripts/
TouchZoom
.ts
View file @
c833d73d
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
declare
const
engine
:
any
;
declare
const
engine
:
any
;
export
default
class
ZoomButton
{
export
default
class
TouchZoom
{
static
id
=
'
zoom-button
'
;
static
id
=
'
touch-zoom
'
;
host
;
host
;
zoomTo
=
1.1
;
zoomTo
=
1.1
;
...
@@ -18,11 +18,11 @@ export default class ZoomButton {
...
@@ -18,11 +18,11 @@ export default class ZoomButton {
this
.
host
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
_onMouseUp
,
this
);
this
.
host
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
_onMouseUp
,
this
);
}
}
_onMouseDown
(
e
)
{
private
_onMouseDown
(
e
)
{
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
this
.
zoomTo
;
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
this
.
zoomTo
;
}
}
_onMouseUp
(
e
)
{
private
_onMouseUp
(
e
)
{
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
1
;
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
1
;
}
}
}
}
examples/scripts/ZoomButton.js
deleted
100644 → 0
View file @
8bd346c5
"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
);
};
ZoomButton
.
prototype
.
_onMouseDown
=
function
(
e
)
{
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
this
.
zoomTo
;
};
ZoomButton
.
prototype
.
_onMouseUp
=
function
(
e
)
{
this
.
host
.
scaleX
=
this
.
host
.
scaleY
=
1
;
};
ZoomButton
.
id
=
'zoom-button'
;
return
ZoomButton
;
}());
exports
[
"default"
]
=
ZoomButton
;
src/zeroing/behavior-runtime/Process.ts
View file @
c833d73d
...
@@ -66,7 +66,7 @@ export class Process {
...
@@ -66,7 +66,7 @@ export class Process {
for
(
let
i
=
0
,
li
=
meta
.
output
.
length
;
i
<
li
;
i
++
)
{
for
(
let
i
=
0
,
li
=
meta
.
output
.
length
;
i
<
li
;
i
++
)
{
const
key
=
meta
.
output
[
i
];
const
key
=
meta
.
output
[
i
];
p
=
this
.
_executeNextProcess
(
key
,
args
);
p
=
this
.
_executeNextProcess
(
key
,
args
);
if
(
i
===
0
)
{
if
(
i
===
li
-
1
)
{
result
=
await
p
;
result
=
await
p
;
}
else
{
}
else
{
p
.
catch
(
e
=>
{
p
.
catch
(
e
=>
{
...
@@ -91,9 +91,9 @@ export class Process {
...
@@ -91,9 +91,9 @@ export class Process {
if
(
this
.
_meta
)
{
if
(
this
.
_meta
)
{
let
metaConfig
=
this
.
_meta
;
let
metaConfig
=
this
.
_meta
;
if
(
metaConfig
)
{
if
(
metaConfig
)
{
this
.
updateProps
(
payload
);
if
(
metaConfig
.
script
)
{
if
(
metaConfig
.
script
)
{
let
func
=
new
Function
(
'args'
,
'props'
,
'target'
,
'global'
,
'vm'
,
warpAsyncScript
(
metaConfig
.
script
));
let
func
=
new
Function
(
'args'
,
'props'
,
'target'
,
'global'
,
'vm'
,
warpAsyncScript
(
metaConfig
.
script
));
this
.
updateProps
(
payload
);
let
globalContext
=
this
.
_vm
.
globalContext
;
let
globalContext
=
this
.
_vm
.
globalContext
;
result
=
await
func
(
payload
,
this
.
_config
.
props
,
this
.
_target
,
globalContext
,
this
.
_vm
);
result
=
await
func
(
payload
,
this
.
_config
.
props
,
this
.
_target
,
globalContext
,
this
.
_vm
);
}
}
...
@@ -204,7 +204,7 @@ export class Process {
...
@@ -204,7 +204,7 @@ export class Process {
}
}
}
}
if
(
props
[
key
]
===
undefined
&&
propsConfig
[
key
].
hasOwnProperty
(
'default'
))
{
if
(
props
[
key
]
===
undefined
&&
propsConfig
[
key
].
hasOwnProperty
(
'default'
))
{
props
[
key
]
=
propsConfig
[
key
][
'default'
];
props
[
key
]
=
propsConfig
[
key
][
'default'
];
}
}
}
}
...
...
src/zeroing/decorators/scripts.ts
View file @
c833d73d
...
@@ -68,13 +68,13 @@ export function registerScriptDef(id, def) {
...
@@ -68,13 +68,13 @@ export function registerScriptDef(id, def) {
});
});
}
}
export
function
registerScripts
(
scripts
){
export
function
registerScripts
(
scripts
)
{
for
(
let
id
in
scripts
)
{
for
(
let
id
in
scripts
)
{
let
code
=
scripts
[
id
];
let
code
=
scripts
[
id
];
let
create
=
new
Function
(
'exports'
,
code
);
let
create
=
new
Function
(
'exports'
,
code
);
let
exports
=
{};
let
exports
:
any
=
{};
create
(
exports
);
create
(
exports
);
registerScriptDef
(
id
,
exports
[
'default'
]
);
registerScriptDef
(
id
,
exports
.
default
);
}
}
}
}
...
...
src/zeroing/game-warpper/data-center.ts
View file @
c833d73d
...
@@ -59,8 +59,10 @@ export class DataCenter extends EventDispatcher {
...
@@ -59,8 +59,10 @@ export class DataCenter extends EventDispatcher {
*/
*/
getDataByName
(
name
,
throwException
?)
{
getDataByName
(
name
,
throwException
?)
{
let
watcher
=
this
.
getWatcher
(
name
);
let
watcher
=
this
.
getWatcher
(
name
);
if
(
watcher
){
return
getDataByPath
(
this
.
store
,
watcher
.
path
,
throwException
);
return
getDataByPath
(
this
.
store
,
watcher
.
path
,
throwException
);
}
}
}
/**
/**
* 填充数据
* 填充数据
...
...
src/zeroing/index.ts
View file @
c833d73d
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
export
*
from
'./launcher'
export
*
from
'./launcher'
export
*
from
'./decorators/scripts'
export
*
from
'./decorators/scripts'
export
*
from
'./decorators/events'
import
{
instantiate
}
from
'./game-warpper/view-interpreter'
import
{
instantiate
}
from
'./game-warpper/view-interpreter'
export
{
export
{
...
...
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