//在类开头加入
private static _ins: 该类类名 = null;
static get ins(): 该类类名 { return this._ins || (this._ins = new 该类类名()); }
//在其他类中就可以使用 该类类名.ins.某方法(); 就可以直接调用该脚本内的方法或变量
这样的好处是方法前面就不用加static前缀了;
//在类开头加入
private static _ins: 该类类名 = null;
static get ins(): 该类类名 { return this._ins || (this._ins = new 该类类名()); }
//在其他类中就可以使用 该类类名.ins.某方法(); 就可以直接调用该脚本内的方法或变量
这样的好处是方法前面就不用加static前缀了;