Commit dd09d269 authored by rockyl's avatar rockyl

去除rollup编译过程

parent 07f8f244
...@@ -5,18 +5,6 @@ ...@@ -5,18 +5,6 @@
"types": "./types/index.d.ts", "types": "./types/index.d.ts",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "rollup -c"
},
"dependencies": {
"tslib": "^1.9.3"
},
"devDependencies": {
"rollup": "^0.66.6",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-typescript2": "^0.18.0",
"rollup-plugin-uglify": "^6.0.0",
"tslib": "^1.9.3",
"typescript": "^3.1.6"
} }
} }
/**
* Created by rockyl on 2018/11/16.
*/
const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const typescript = require('rollup-plugin-typescript2');
const {uglify} = require('rollup-plugin-uglify');
export default {
input: 'src/index.ts',
output: {
file: 'dist/bundle.js',
format: 'umd',
name: 'scilla',
//sourcemap: true,
},
plugins: [
resolve({
browser: true,
}),
typescript({
typescript: require('typescript'),
tslib: require('tslib'),
useTsconfigDeclarationDir: true,
}),
commonjs(),
//uglify({}),
]
};
...@@ -13,6 +13,7 @@ import {EngineConfig} from "../engine-config"; ...@@ -13,6 +13,7 @@ import {EngineConfig} from "../engine-config";
let resCache = {}; let resCache = {};
let resPath = ''; let resPath = '';
let resCacheProxy;
const resLoaderType = { const resLoaderType = {
'.json': loadJson, '.json': loadJson,
...@@ -420,9 +421,16 @@ export function addLoader(ext, loader) { ...@@ -420,9 +421,16 @@ export function addLoader(ext, loader) {
* @param uuid * @param uuid
*/ */
export function getRes(uuid) { export function getRes(uuid) {
if(resCacheProxy){
return resCacheProxy(uuid);
}
return resCache[uuid]; return resCache[uuid];
} }
export function setResCacheProxy(proxyFunc){
resCacheProxy = proxyFunc;
}
/** /**
* 销毁资源 * 销毁资源
* @param uuidOrUuids * @param uuidOrUuids
......
...@@ -304,7 +304,11 @@ function injectBaseType(node, key, propertyOfConfig, pid?) { ...@@ -304,7 +304,11 @@ function injectBaseType(node, key, propertyOfConfig, pid?) {
propertyValue = propertyOfConfig; propertyValue = propertyOfConfig;
} }
node[key] = propertyValue; let keyAvatar = key;
if(propertyValue instanceof Promise){
keyAvatar = 'async_' + keyAvatar;
}
node[keyAvatar] = propertyValue;
} }
function injectEvent(event: ScillaEvent, config, pid?) { function injectEvent(event: ScillaEvent, config, pid?) {
......
...@@ -191,6 +191,13 @@ export default class Matrix { ...@@ -191,6 +191,13 @@ export default class Matrix {
} }
} }
/**
* 获取弧度
*/
get rotation(){
return Math.atan2(this.b, this.a);
}
/** /**
* 对矩阵应用缩放转换。x 轴乘以 sx,y 轴乘以 sy。 * 对矩阵应用缩放转换。x 轴乘以 sx,y 轴乘以 sy。
* scale() 方法将更改 Matrix 对象的 a 和 d 属性。 * scale() 方法将更改 Matrix 对象的 a 和 d 属性。
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment