12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- // Learn TypeScript:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
- // Learn Attribute:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
- import EventName, { GuideType } from "../EventName/EventName";
- import LocalData from "../LocalData";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class CanmeraScrpts extends cc.Component {
- Character: cc.Node = null;//人物节点
- protected onLoad(): void {
- let Mask = this.node.getChildByName("Mask")
-
- if (CC_DEBUG) {
- Mask.active = true
- }else{
- Mask.active = true
- }
- }
- protected lateUpdate(dt: number): void {
- this?.node?.setPosition(this?.Character?.position.x, this?.Character?.position.y + 550)
- }
- BronAni() {
- let Mask = this.node.getChildByName("Mask")
- cc.tween(Mask)
- .to(0, { opacity: 255 })
- .to(1, { opacity: 0 }, { easing: 'fadeOut' })
- .call(() => {
- Mask.destroy()
- //加载完毕先判断是否要教学
- if (!LocalData.getInstance().getGuide(GuideType.基本跳跃教学引导)) {
- cc.systemEvent.emit(EventName.ShowGuide, GuideType.基本跳跃教学引导)
- }
- })
- .start()
- }
- }
|