新增场景策略适配
This commit is contained in:
@@ -59,7 +59,7 @@ module es {
|
||||
* @param eventType 事件类型
|
||||
* @param data 事件数据
|
||||
*/
|
||||
public emit(eventType: T, data?: any) {
|
||||
public emit(eventType: T, ...data: any[]) {
|
||||
let list: FuncPack[] = this._messageTable.get(eventType);
|
||||
if (list) {
|
||||
for (let i = list.length - 1; i >= 0; i--)
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
module es {
|
||||
/**
|
||||
* 使得number/string/boolean类型作为对象引用来进行传递
|
||||
*/
|
||||
export class Ref<T extends number | string | boolean> {
|
||||
export class Ref<T> {
|
||||
public value: T;
|
||||
|
||||
constructor(value: T){
|
||||
constructor(value: T) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
14
source/src/Utils/Screen.ts
Normal file
14
source/src/Utils/Screen.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
module es {
|
||||
export class Screen {
|
||||
public static width: number;
|
||||
public static height: number;
|
||||
|
||||
public static get size(): Vector2 {
|
||||
return new Vector2(this.width, this.height);
|
||||
}
|
||||
|
||||
public static get center(): Vector2 {
|
||||
return new Vector2(this.width / 2, this.height / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user