buff_show.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { _decorator, Component, Node } from 'cc';
  2. import { buff_time_count } from './buff_time_count';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('buff_show')
  5. export class buff_show extends Component {
  6. @property(Node) icon_buff_xi:Node = null;
  7. @property(Node) icon_buff_xing:Node = null;
  8. @property(Node) icon_buff_dun:Node = null;
  9. public initView(){
  10. this.icon_buff_xi.active = false;
  11. this.icon_buff_xing.active = false;
  12. this.icon_buff_dun.active = false;
  13. }
  14. public showBuffXi(cb,time:number){
  15. this.icon_buff_xi.getComponent(buff_time_count).startBuffTimeCount(cb,time)
  16. this.icon_buff_xi.active = true;
  17. }
  18. public hideBuffXi(){
  19. this.icon_buff_xi.getComponent(buff_time_count).cancelTimeCount()
  20. this.icon_buff_xi.active = false;
  21. }
  22. public showBuffXing(cb,time:number){
  23. this.icon_buff_xing.getComponent(buff_time_count).startBuffTimeCount(cb,time)
  24. this.icon_buff_xing.active = true;
  25. }
  26. public hideBuffXing(){
  27. this.icon_buff_xing.getComponent(buff_time_count).cancelTimeCount()
  28. this.icon_buff_xing.active = false;
  29. }
  30. public showBuffDun(cb,time:number){
  31. this.icon_buff_dun.getComponent(buff_time_count).startBuffTimeCount(cb,time)
  32. this.icon_buff_dun.active = true;
  33. }
  34. public hideBuffDun(){
  35. this.icon_buff_dun.getComponent(buff_time_count).cancelTimeCount()
  36. this.icon_buff_dun.active = false;
  37. }
  38. public getBuffXing(){
  39. return this.icon_buff_xing
  40. }
  41. public getBuffXi(){
  42. return this.icon_buff_xi
  43. }
  44. public getBuffDun(){
  45. return this.icon_buff_dun
  46. }
  47. }