123456789101112131415161718192021222324252627282930313233343536 |
- import FF from "../FF";
- import FSprite from "../object/FSprite";
- import WOneByone from "./map1/WOneByone";
- const {ccclass, property} = cc._decorator;
- @ccclass
- export default class FDialogMonster extends cc.Component {
- @property(cc.Prefab)
- mMapDialog: cc.Prefab = null;
- @property([cc.String])
- text: Array<string> = [];
- private ff:FF;
- public showDialog(){
- let dialogs = this.text;
- let node = cc.instantiate(this.mMapDialog);
- node.group = 'map'
- node.zIndex = 9999;
- node.x = this.node.x;
- node.y = this.node.y + this.node.height;
- node.parent = this.ff.mMap.mSprites;
- let obo = node.getComponent(WOneByone);
- obo.dialogs = dialogs;
- obo.setCallback(()=>{
- node.destroy();
- });
- obo._start();
- }
- }
|