attributes_remark.ts 658 B

1234567891011121314151617181920212223
  1. import { _decorator, Component, EditBox, Node } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('attributes_remark')
  4. export class attributes_remark extends Component {
  5. @property(Node) editBox:Node = null;
  6. private m_callback: Function = null;
  7. initView(callback:Function) {
  8. this.m_callback = callback
  9. }
  10. public update_att(remark:string){
  11. if(remark==undefined||remark==null){ remark = ''}
  12. this.editBox.getComponent(EditBox).string = remark
  13. }
  14. public editBoxEditingDidEnded(editBox: EditBox) {
  15. if(this.m_callback != null) {
  16. this.m_callback(editBox.string)
  17. }
  18. }
  19. }