| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- // Learn TypeScript:
- // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
- // Learn Attribute:
- // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
- import GuideLabel from "./GuideLabel";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class FocusEff extends cc.Component {
- @property(cc.Node)
- maskNode: cc.Node = null;
- @property(cc.Node)
- desNode: cc.Node = null;
- @property(cc.Node)
- loadBlock: cc.Node = null;
- @property(cc.Node) //有些步骤的desNode不是直接指向文字内容,重新引用一个新的
- talkNode: cc.Node = null;
- @property(cc.Node)
- headIcon:cc.Node = null
- @property(cc.Node)
- talkBg:cc.Node = null
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {}
- start() {
- }
- onEnable() {
- this.loadBlock.active = true
- this.maskNode.setScale(15)
- if (this.desNode) {
- this.desNode.active = false
- }
- if(cc.isValid(this.talkNode)){
- this.talkNode.active = false
- }
- if(cc.isValid(this.headIcon)){
- this.headIcon.active = false
- }
- if(cc.isValid(this.talkBg)){
- this.talkBg.active = false
- }
- cc.tween(this.maskNode)
- .to(0.3, { scale: 1 })
- .call(() => {
- if (this.desNode) {
- this.desNode.active = true
- }
- })
- .delay(0.3)
- .call(() => {
- this.loadBlock.active = false
- if(cc.isValid(this.desNode)){
- this.desNode.active = true
- }
- if(cc.isValid(this.headIcon)){
- this.headIcon.active = true
- }
-
- if(cc.isValid(this.talkBg)){
- this.talkBg.active = true
- }
- if(cc.isValid(this.talkNode)){
- this.talkNode.active = true
- let gLbale = this.talkNode.addComponent(GuideLabel)
- // gLbale.setView()
- }
- })
- .start()
- }
- // update (dt) {}
- }
|