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
8bd346c5
Commit
8bd346c5
authored
Nov 19, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataInput修复
parent
88b0d47d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
8 deletions
+38
-8
mergeDts.js
scripts/mergeDts.js
+1
-0
DisplayObject.ts
src/2d/display/DisplayObject.ts
+4
-0
Process.ts
src/zeroing/behavior-runtime/Process.ts
+12
-5
VM.ts
src/zeroing/behavior-runtime/VM.ts
+9
-1
GameStage.ts
src/zeroing/game-warpper/GameStage.ts
+2
-2
data-center.ts
src/zeroing/game-warpper/data-center.ts
+10
-0
No files found.
scripts/mergeDts.js
View file @
8bd346c5
...
...
@@ -45,6 +45,7 @@ declare const args: any;
declare const props: any;
declare const target: engine.Container;
declare const global: any;
declare const vm: engine.VM;
declare function next(type: string, payload?: any);
...
...
src/2d/display/DisplayObject.ts
View file @
8bd346c5
...
...
@@ -608,6 +608,10 @@ export class DisplayObject extends EventDispatcher {
* 更新方法,帧循环的监听事件放在这
*/
public
update
(
deltaTime
:
number
)
{
//监听的
if
(
this
.
hasEventListener
(
Event
.
ENTER_FRAME
))
{
this
.
dispatchEvent
(
Event
.
ENTER_FRAME
,
deltaTime
);
}
}
}
/**
...
...
src/zeroing/behavior-runtime/Process.ts
View file @
8bd346c5
...
...
@@ -92,9 +92,10 @@ export class Process {
let
metaConfig
=
this
.
_meta
;
if
(
metaConfig
)
{
if
(
metaConfig
.
script
)
{
let
func
=
new
Function
(
'args'
,
'props'
,
'target'
,
'global'
,
warpAsyncScript
(
metaConfig
.
script
));
let
func
=
new
Function
(
'args'
,
'props'
,
'target'
,
'global'
,
'vm'
,
warpAsyncScript
(
metaConfig
.
script
));
this
.
updateProps
(
payload
);
result
=
await
func
(
payload
,
this
.
_config
.
props
,
this
.
_target
,
this
.
_vm
.
getGlobalContext
());
let
globalContext
=
this
.
_vm
.
globalContext
;
result
=
await
func
(
payload
,
this
.
_config
.
props
,
this
.
_target
,
globalContext
,
this
.
_vm
);
}
}
else
{
console
.
warn
(
`process meta [
${
meta
}
] not found`
)
...
...
@@ -173,7 +174,8 @@ export class Process {
updateProps
(
args
)
{
if
(
this
.
_originProps
)
{
let
props
=
this
.
_config
.
props
;
for
(
let
key
in
props
)
{
let
propsConfig
=
this
.
_meta
.
props
;
for
(
let
key
in
propsConfig
)
{
let
value
=
this
.
_originProps
[
key
];
const
valueType
=
typeof
value
;
if
(
valueType
==
'object'
)
{
...
...
@@ -191,15 +193,20 @@ export class Process {
props
[
key
]
=
args
?
getDataByPath
(
args
,
value
.
value
)
:
undefined
;
break
;
case
'data-center'
:
props
[
key
]
=
dataCenter
.
getDataByPath
(
value
.
value
);
let
nameValue
=
dataCenter
.
getDataByName
(
value
.
value
);
props
[
key
]
=
nameValue
!==
undefined
?
nameValue
:
dataCenter
.
getDataByPath
(
value
.
value
);
break
;
}
}
else
if
(
value
&&
value
.
indexOf
&&
value
.
indexOf
(
nodeScheme
)
===
0
)
{
let
uuid
=
value
.
replace
(
nodeScheme
,
''
);
if
(
uuid
)
{
props
[
key
]
=
findNodeByUUID
(
this
.
_vm
.
g
etGlobalContext
()
.
gameStage
,
uuid
);
props
[
key
]
=
findNodeByUUID
(
this
.
_vm
.
g
lobalContext
.
gameStage
,
uuid
);
}
}
if
(
props
[
key
]
===
undefined
&&
propsConfig
[
key
].
hasOwnProperty
(
'default'
)){
props
[
key
]
=
propsConfig
[
key
][
'default'
];
}
}
}
}
...
...
src/zeroing/behavior-runtime/VM.ts
View file @
8bd346c5
...
...
@@ -5,10 +5,13 @@
import
{
Process
}
from
"./Process"
;
import
{
arrayFind
}
from
"../utils"
;
let
ID_INK
=
0
;
export
class
VM
{
_processMetaLibs
;
_globalContext
;
_target
;
_id
;
setup
(
context
)
{
const
{
processMetaLibs
,
globalContext
,
target
}
=
context
;
...
...
@@ -16,6 +19,7 @@ export class VM {
this
.
_processMetaLibs
=
processMetaLibs
;
this
.
_globalContext
=
globalContext
;
this
.
_target
=
target
;
this
.
_id
=
ID_INK
++
;
}
async
executeProcess
(
sequence
,
id
,
parentProcess
,
args
)
{
...
...
@@ -40,7 +44,11 @@ export class VM {
}
}
get
GlobalContext
()
{
get
globalContext
()
{
return
this
.
_globalContext
;
}
get
id
()
{
return
this
.
_id
;
}
}
src/zeroing/game-warpper/GameStage.ts
View file @
8bd346c5
...
...
@@ -38,9 +38,9 @@ export class GameStage extends Container {
let
blackLayer
=
this
.
_blackLayer
=
new
Rect
();
this
.
addChild
(
this
.
_sceneContainer
=
new
StackContainer
(
false
));
this
.
addChild
(
this
.
_sceneContainer
=
new
StackContainer
());
this
.
addChild
(
blackLayer
);
this
.
addChild
(
this
.
_popupContainer
=
new
StackContainer
());
this
.
addChild
(
this
.
_popupContainer
=
new
StackContainer
(
false
));
blackLayer
[
'percentWidth'
]
=
100
;
blackLayer
[
'percentHeight'
]
=
100
;
...
...
src/zeroing/game-warpper/data-center.ts
View file @
8bd346c5
...
...
@@ -52,6 +52,16 @@ export class DataCenter extends EventDispatcher {
return
getDataByPath
(
this
.
store
,
path
,
throwException
);
}
/**
* 根据绑定名获取数据
* @param name
* @param throwException
*/
getDataByName
(
name
,
throwException
?)
{
let
watcher
=
this
.
getWatcher
(
name
);
return
getDataByPath
(
this
.
store
,
watcher
.
path
,
throwException
);
}
/**
* 填充数据
* @param str
...
...
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