Commit dd09d269 authored by rockyl's avatar rockyl

去除rollup编译过程

parent 07f8f244
......@@ -5,18 +5,6 @@
"types": "./types/index.d.ts",
"license": "MIT",
"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";
let resCache = {};
let resPath = '';
let resCacheProxy;
const resLoaderType = {
'.json': loadJson,
......@@ -420,9 +421,16 @@ export function addLoader(ext, loader) {
* @param uuid
*/
export function getRes(uuid) {
if(resCacheProxy){
return resCacheProxy(uuid);
}
return resCache[uuid];
}
export function setResCacheProxy(proxyFunc){
resCacheProxy = proxyFunc;
}
/**
* 销毁资源
* @param uuidOrUuids
......
......@@ -304,7 +304,11 @@ function injectBaseType(node, key, propertyOfConfig, pid?) {
propertyValue = propertyOfConfig;
}
node[key] = propertyValue;
let keyAvatar = key;
if(propertyValue instanceof Promise){
keyAvatar = 'async_' + keyAvatar;
}
node[keyAvatar] = propertyValue;
}
function injectEvent(event: ScillaEvent, config, pid?) {
......
......@@ -191,6 +191,13 @@ export default class Matrix {
}
}
/**
* 获取弧度
*/
get rotation(){
return Math.atan2(this.b, this.a);
}
/**
* 对矩阵应用缩放转换。x 轴乘以 sx,y 轴乘以 sy。
* 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