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