| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- cc.Class({
- extends: cc.Component,
- properties: {
- GameMode: {
- default: null,
- type: cc.Node,
- serializable: true,
- },
- SwichOnVoice: {
- default: null,
- type: cc.AudioClip,
- serializable: true,
- },
- Girl: {
- default: null,
- type: cc.Node,
- serializable: true,
- },
- ChiVoice: {
- default: null,
- type: cc.AudioClip,
- serializable: true,
- },
- },
- start()
- {
- this.StoryController = this.GameMode.getComponent('StoryController');
- },
- startRobot(event,customData) {
- cc.audioEngine.playEffect(this.SwichOnVoice, false);
- this.StoryController.Conversation.active = false;
- this.SwitchFadeOutAnim();
- },
- SwitchFadeOutAnim()
- {
- let action = cc.fadeOut(2);
- let CallF = cc.callFunc(function(){
- // this.EnableTouch = true;
- // this.node.active=false;
- this.GirlFadeInAnim();
- }.bind(this));
- let FadeInAnim = cc.sequence(action,CallF);
- this.node.runAction(FadeInAnim);
- },
- GirlFadeInAnim()
- {
- let action = cc.fadeIn(1);
- let CallF = cc.callFunc(function(){
- this.StoryController.EnableTouch = true;
- this.StoryController.Conversation.active = true;
- this.StoryController.PlayConversation();
- cc.audioEngine.playEffect(this.ChiVoice, false);
- //close block touch node
- this.node.destroy();
- this.Girl.getChildByName('GameTouchHead').active = false;
- this.Girl.getChildByName('GameTouchChest').active = false;
- }.bind(this));
- let FadeInAnim = cc.sequence(action,CallF);
- this.Girl.active=true;
- this.Girl.opacity = 0;
- this.Girl.runAction(FadeInAnim);
- }
- });
|