|
@@ -1,4 +1,4 @@
|
|
|
-import { _decorator, Component, Label, Node, sys, Animation, resources, Prefab, instantiate } from 'cc';
|
|
|
+import { _decorator, Component, Label, Node, sys, Animation, resources, Prefab, instantiate, Tween, SpriteFrame, Sprite, UIOpacity } from 'cc';
|
|
|
import { yinyue } from './yinyue';
|
|
|
import { yinxiao } from './yinxiao';
|
|
|
import { peiyin } from './peiyin';
|
|
@@ -14,12 +14,19 @@ export class login_view extends Component {
|
|
|
@property(Node) yinyue:Node = null;
|
|
|
@property(Node) yinxiao:Node = null;
|
|
|
@property(Node) peiyin:Node = null;
|
|
|
- @property(Node) clock:Node = null;
|
|
|
+ @property(Node) clock_node:Node = null;
|
|
|
+ @property(Node) book_img:Node = null;
|
|
|
@property(Node) btn_clear_data:Node = null;
|
|
|
@property(Node) btn_check_debug:Node = null;
|
|
|
@property(Node) lab_check_debug:Node = null;
|
|
|
@property(Node) btn_sidebar_box:Node = null;
|
|
|
private m_start_game_call = null;
|
|
|
+ private book_img_original_sf:SpriteFrame = null;
|
|
|
+ private is_start_game:boolean = false;
|
|
|
+
|
|
|
+ protected start(): void {
|
|
|
+ this.book_img_original_sf = this.book_img.getComponent(Sprite).spriteFrame
|
|
|
+ }
|
|
|
|
|
|
public initView(start_game_call){
|
|
|
if(config.debug){
|
|
@@ -41,9 +48,13 @@ export class login_view extends Component {
|
|
|
|
|
|
this.m_start_game_call = start_game_call;
|
|
|
this.btn_start.off(Node.EventType.TOUCH_END)
|
|
|
- this.btn_start.on(Node.EventType.TOUCH_END,()=>{
|
|
|
+ this.btn_start.on(Node.EventType.TOUCH_END,()=>{
|
|
|
+ if(this.is_start_game) { return }
|
|
|
+ this.is_start_game = true
|
|
|
if(this.m_start_game_call!=null){
|
|
|
- this.m_start_game_call()
|
|
|
+ this.startGame()
|
|
|
+ } else {
|
|
|
+ this.is_start_game = false
|
|
|
}
|
|
|
gameManager.Singleton.sys_click_button_music()
|
|
|
})
|
|
@@ -53,17 +64,24 @@ export class login_view extends Component {
|
|
|
this.peiyin.getComponent(peiyin).initView()
|
|
|
}
|
|
|
|
|
|
+ private startGame() {
|
|
|
+ this.node.getComponent(Animation).play()
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.is_start_game = false
|
|
|
+ this.m_start_game_call()
|
|
|
+ },920)
|
|
|
+ }
|
|
|
+
|
|
|
public show() {
|
|
|
- this.node.active = true
|
|
|
- this.clock.getComponent(Animation).play()
|
|
|
+ this.clock_node.getComponent(Animation).play()
|
|
|
if(this.btn_sidebar_box.active) {
|
|
|
this.btn_sidebar_box.getComponent(Animation).play()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public hide() {
|
|
|
- this.node.active = false
|
|
|
- this.clock.getComponent(Animation).stop()
|
|
|
+ this.book_img.getComponent(Sprite).spriteFrame = this.book_img_original_sf
|
|
|
+ this.clock_node.getComponent(Animation).stop()
|
|
|
if(this.btn_sidebar_box.active) {
|
|
|
this.btn_sidebar_box.getComponent(Animation).stop()
|
|
|
}
|