[add] Speak
This commit is contained in:
parent
587caaa9b4
commit
a19c092ea1
@ -254,7 +254,7 @@
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 0,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
|
@ -29,7 +29,7 @@ export default class Manager extends cc.Component {
|
||||
let data: any = e.data;
|
||||
let method: string = data.method;
|
||||
let value: any = data.value;
|
||||
self.Birdge(method, value)
|
||||
self.Birdge(method, ...value)
|
||||
}, false);
|
||||
|
||||
if (!window["Bridge"]) {
|
||||
@ -47,6 +47,10 @@ export default class Manager extends cc.Component {
|
||||
this._resize();
|
||||
}
|
||||
|
||||
/** 跨版本溝通
|
||||
* @example
|
||||
* CallParent('Speak', '我愛豬涵')
|
||||
*/
|
||||
public Birdge(method: string, value: string = ""): void {
|
||||
let self: this = this;
|
||||
if (method && self[method]) {
|
||||
@ -61,16 +65,11 @@ export default class Manager extends cc.Component {
|
||||
console.log(`not function: ${method}, value: ${value}`);
|
||||
}
|
||||
|
||||
private _closeBG(): void {
|
||||
if (this.webview.node.opacity === 0) {
|
||||
this.BG.destroy();
|
||||
this.webview.node.opacity = 255;
|
||||
this.webview.node.active = false;
|
||||
this.webview.node.active = true;
|
||||
}
|
||||
public CloseBG(): void {
|
||||
this.BG.destroy();
|
||||
}
|
||||
|
||||
private _log(msg: string): void {
|
||||
public Log(msg: string): void {
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
@ -78,7 +77,7 @@ export default class Manager extends cc.Component {
|
||||
this._text_to_Speech.speak(msg);
|
||||
}
|
||||
|
||||
private _alert(msg: string): void {
|
||||
public Alert(msg: string): void {
|
||||
alert(msg);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user