|
@@ -1,4 +1,4 @@
|
|
|
-import { _decorator, color, Color, Component, EventTouch, find, instantiate, Label, log, Node, Prefab, ScrollView, Sprite, tween, UIOpacity, UITransform, Vec2, Vec3 } from 'cc';
|
|
|
+import { _decorator, CCInteger, CCString, color, Color, Component, EventTouch, find, instantiate, Label, log, Node, Prefab, ScrollView, Sprite, tween, UIOpacity, UITransform, Vec2, Vec3 } from 'cc';
|
|
|
import EventMgr from '../../script/Manager/EventMgr';
|
|
|
import { LayerMgr } from '../../script/Manager/LayerMgr';
|
|
|
import { GameCfg } from '../../script/Config/GameCfg';
|
|
@@ -24,6 +24,7 @@ export class BaseZhaocha extends Component {
|
|
|
|
|
|
arr_areadygetnum: Array<number> = []
|
|
|
|
|
|
+
|
|
|
answerName: Array<string> = [
|
|
|
// "安全带",
|
|
|
// "可乐",
|
|
@@ -159,11 +160,16 @@ export class BaseZhaocha extends Component {
|
|
|
// }
|
|
|
return this.sv_cha.content.children[this.arr_areadygetnum.length - 1]
|
|
|
}
|
|
|
-
|
|
|
ShowTishi() {
|
|
|
+
|
|
|
+ console.log(this.num_showTip)
|
|
|
for (let index = 0; index < this.answerName.length; index++) {
|
|
|
if (this.arr_areadygetnum.indexOf(index) == -1 && !this.arr_node_allitem[index].getComponent(Sprite).color.equals(Color.GREEN)) {
|
|
|
- if (this.num_showTip == index) {
|
|
|
+ if (this.tishi_indexs.length != 0) {
|
|
|
+ let idx = this.tishi_indexs.pop()
|
|
|
+ this.ShowTishiView2(this.arr_tishi[idx])
|
|
|
+ }
|
|
|
+ else if (this.num_showTip == index) {
|
|
|
// if (this.arr_node_allitem[index].active) {
|
|
|
// this.arr_node_allitem[index].getComponent(Sprite).color = Color.YELLOW//new Color(57, 226, 42, 255)
|
|
|
// console.log("active = true")
|
|
@@ -188,13 +194,26 @@ export class BaseZhaocha extends Component {
|
|
|
}
|
|
|
|
|
|
num_showTip = -1
|
|
|
- str_tishi = ""
|
|
|
+ protected str_tishi = ""
|
|
|
+
|
|
|
+ @property([CCString])
|
|
|
+ public arr_tishi: Array<string> = []
|
|
|
+
|
|
|
+ @property([CCInteger])
|
|
|
+ public tishi_indexs: Array<number> = []
|
|
|
+
|
|
|
ShowTishiView() {
|
|
|
LayerMgr.instance.ShowPrefab(BundleName.hall, "prefab/page_tishi", (node) => {
|
|
|
node.getComponent(page_tishi).Init(this.str_tishi)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ ShowTishiView2(str: string) {
|
|
|
+ LayerMgr.instance.ShowPrefab(BundleName.hall, "prefab/page_tishi", (node) => {
|
|
|
+ node.getComponent(page_tishi).Init(str)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
protected onDestroy(): void {
|
|
|
console.log("退出关卡")
|
|
|
this.unscheduleAllCallbacks()
|