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
672906ea
Commit
672906ea
authored
Nov 18, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改过程属性链接方式
parent
3ef630dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
Process.ts
src/zeroing/behavior-runtime/Process.ts
+15
-5
utils.ts
src/zeroing/utils.ts
+1
-1
No files found.
src/zeroing/behavior-runtime/Process.ts
View file @
672906ea
...
...
@@ -7,7 +7,7 @@ import {VM} from "./VM";
import
{
linkedFlag
,
nodeScheme
,
objClone
}
from
"../utils"
;
import
{
findNodeByUUID
}
from
"../node-utils"
;
const
log
=
fals
e
;
const
log
=
tru
e
;
export
class
Process
{
private
_config
;
...
...
@@ -166,11 +166,12 @@ export class Process {
let
props
=
this
.
_config
.
props
;
for
(
let
key
in
props
)
{
let
value
=
this
.
_originProps
[
key
];
if
(
value
===
linkedFlag
)
{
if
(
this
.
_parent
)
{
props
[
key
]
=
this
.
_parent
.
getProps
(
key
);
if
(
typeof
value
==
'object'
)
{
let
linkedValue
=
this
.
resolveLinkedProp
(
value
,
key
);
if
(
linkedValue
!==
undefined
)
{
props
[
key
]
=
linkedValue
;
}
}
else
if
(
value
.
indexOf
(
nodeScheme
)
===
0
)
{
}
else
if
(
value
&&
value
.
indexOf
&&
value
.
indexOf
(
nodeScheme
)
===
0
)
{
let
uuid
=
value
.
replace
(
nodeScheme
,
''
);
if
(
uuid
)
{
props
[
key
]
=
findNodeByUUID
(
this
.
_vm
.
getGlobalContext
().
gameStage
,
uuid
);
...
...
@@ -179,10 +180,19 @@ export class Process {
}
}
}
resolveLinkedProp
(
data
,
key
)
{
let
linkedKey
=
data
.
alias
||
key
;
if
(
this
.
_parent
)
{
return
this
.
_parent
.
getProps
(
linkedKey
);
}
}
}
function
warpAsyncScript
(
source
)
{
return
`return new Promise(function(resolve, reject){
${
source
}
function next(type, payload){resolve({type: type, payload: payload})}
});`
;
}
src/zeroing/utils.ts
View file @
672906ea
...
...
@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-08.
*/
export
const
ESCAPE_REG_EXP
=
/
\$\{[
_a-zA-Z
]\w
*
\}
/g
;
export
const
ESCAPE_REG_EXP
=
/
\$\{[
\u
4e00-
\u
9fa5_a-zA-Z0-9
]
+
\}
/g
;
export
const
linkedFlag
=
'$_linked_$'
;
export
const
nodeScheme
=
'node://'
;
...
...
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