Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scilla-core
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
劳工
scilla-core
Commits
ac856bdf
Commit
ac856bdf
authored
Mar 20, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改CameraController方便UI适配
parent
8148721c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
19 deletions
+24
-19
package.json
package.json
+1
-1
rollup.config.js
rollup.config.js
+1
-1
ReType.ts
src/ReType.ts
+0
-0
index.ts
src/editor/index.ts
+2
-2
interpreter.ts
src/editor/interpreter.ts
+17
-12
tsconfig.json
tsconfig.json
+3
-3
No files found.
package.json
View file @
ac856bdf
{
{
"name"
:
"scilla-core"
,
"name"
:
"scilla-core"
,
"version"
:
"1.0.0"
,
"version"
:
"1.0.0"
,
"main"
:
"./dist/
bundle
.js"
,
"main"
:
"./dist/
index
.js"
,
"types"
:
"./types/index.d.ts"
,
"types"
:
"./types/index.d.ts"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
"scripts"
:
{
"scripts"
:
{
...
...
rollup.config.js
View file @
ac856bdf
...
@@ -25,6 +25,6 @@ export default {
...
@@ -25,6 +25,6 @@ export default {
useTsconfigDeclarationDir
:
true
,
useTsconfigDeclarationDir
:
true
,
}),
}),
commonjs
(),
commonjs
(),
uglify
({}),
//
uglify({}),
]
]
};
};
src/ReType.
d.
ts
→
src/ReType.ts
View file @
ac856bdf
File moved
src/editor/index.ts
View file @
ac856bdf
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* Created by rockyl on 2018-12-04.
* Created by rockyl on 2018-12-04.
*/
*/
import
{
destroyScene
,
setupScene
,
}
from
"./interpreter"
;
import
{
cleanEntity
,
setupScene
,
}
from
"./interpreter"
;
import
{
addLoader
,
cacheRes
,
destroyRes
,
getAllResUuids
,
loadJson5
}
from
"../assets-manager"
;
import
{
addLoader
,
cacheRes
,
destroyRes
,
getAllResUuids
,
loadJson5
}
from
"../assets-manager"
;
import
{
getRoot
,
pause
,
Scene
,
start
}
from
"../core"
;
import
{
getRoot
,
pause
,
Scene
,
start
}
from
"../core"
;
...
@@ -49,7 +49,7 @@ export function mountScene(scene){
...
@@ -49,7 +49,7 @@ export function mountScene(scene){
*/
*/
export
function
unmountScene
(
scene
){
export
function
unmountScene
(
scene
){
pause
();
pause
();
destroyScene
(
scene
);
cleanEntity
(
scene
.
root
);
destroyRes
(
resUUIDs
);
destroyRes
(
resUUIDs
);
}
}
...
...
src/editor/interpreter.ts
View file @
ac856bdf
...
@@ -38,13 +38,12 @@ export function setupScene(scene: Scene, root: Entity): Scene {
...
@@ -38,13 +38,12 @@ export function setupScene(scene: Scene, root: Entity): Scene {
}
}
/**
/**
*
销毁场景
*
清空实体
* @param
scene
* @param
entity
*/
*/
export
function
destroyScene
(
scene
:
Scene
)
{
export
function
cleanEntity
(
entity
:
Entity
)
{
const
root
=
scene
.
root
;
entity
.
removeAllComponents
();
root
.
removeAllComponents
();
entity
.
removeChildren
();
root
.
removeChildren
();
}
}
/**
/**
...
@@ -187,12 +186,17 @@ function injectComponents(entity: Entity, config: any, pid?) {
...
@@ -187,12 +186,17 @@ function injectComponents(entity: Entity, config: any, pid?) {
const
components
=
entity
.
components
;
const
components
=
entity
.
components
;
for
(
let
i
=
0
,
li
=
config
.
components
.
length
;
i
<
li
;
i
++
)
{
for
(
let
i
=
0
,
li
=
config
.
components
.
length
;
i
<
li
;
i
++
)
{
const
component
=
config
.
components
[
i
];
const
component
=
config
.
components
[
i
];
const
{
properties
}
=
component
;
if
(
properties
)
{
injectComponentProperties
(
components
[
i
],
component
,
pid
);
injectProperties
(
components
[
i
],
properties
,
pid
);
}
}
}
}
}
export
function
injectComponentProperties
(
component
,
config
,
pid
?){
const
{
properties
}
=
config
;
if
(
properties
)
{
injectProperties
(
component
,
properties
,
pid
);
}
}
}
}
...
@@ -201,8 +205,8 @@ function injectComponents(entity: Entity, config: any, pid?) {
...
@@ -201,8 +205,8 @@ function injectComponents(entity: Entity, config: any, pid?) {
* @param entity
* @param entity
* @param config
* @param config
*/
*/
function
instantiateComponent
(
entity
:
Entity
,
config
:
any
)
{
export
function
instantiateComponent
(
entity
:
Entity
,
config
:
any
)
{
const
{
script
,
properties
}
=
config
;
const
{
script
,
}
=
config
;
let
def
=
getDefByName
(
script
);
let
def
=
getDefByName
(
script
);
...
@@ -214,6 +218,7 @@ function instantiateComponent(entity: Entity, config: any) {
...
@@ -214,6 +218,7 @@ function instantiateComponent(entity: Entity, config: any) {
entity
.
addComponent
(
instance
);
entity
.
addComponent
(
instance
);
return
instance
;
}
}
/**
/**
...
...
tsconfig.json
View file @
ac856bdf
{
{
"compilerOptions"
:
{
"compilerOptions"
:
{
"target"
:
"es5"
,
"target"
:
"es5"
,
"outDir"
:
"dist"
,
"experimentalDecorators"
:
true
,
"experimentalDecorators"
:
true
,
"sourceMap"
:
true
,
"sourceMap"
:
true
,
"declarationDir"
:
"
./
types"
,
"declarationDir"
:
"types"
,
"declaration"
:
true
,
"declaration"
:
true
,
"lib"
:
[
"lib"
:
[
"es5"
,
"es5"
,
...
@@ -13,7 +14,6 @@
...
@@ -13,7 +14,6 @@
]
]
},
},
"include"
:
[
"include"
:
[
"src"
,
"src"
"libs"
]
]
}
}
\ No newline at end of file
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