Layout_Rank.ts 981 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { _decorator, Button, Component, Node, Toggle } from 'cc';
  2. import { UI_Rank_Item } from './UI_Rank_Item';
  3. import List from '../../../core/util_comp/List';
  4. const { ccclass, property } = _decorator;
  5. @ccclass('Layout_Rank')
  6. export class Layout_Rank extends Component {
  7. @property(Button)
  8. Close_Btn: Button;
  9. @property(Toggle)
  10. Rank_Toggle_1: Toggle;
  11. @property(Toggle)
  12. Rank_Toggle_2: Toggle;
  13. //列表
  14. @property(List)
  15. list1: List = null;
  16. //列表
  17. @property(List)
  18. list2: List = null;
  19. @property(UI_Rank_Item)
  20. own1_item: UI_Rank_Item;
  21. @property(UI_Rank_Item)
  22. own2_item: UI_Rank_Item;
  23. public onList1: Function;
  24. public onList2: Function;
  25. onListRender1(item: any, idx: number) {
  26. this.onList1?.(item, idx);
  27. }
  28. onListRender2(item: any, idx: number) {
  29. this.onList2?.(item, idx);
  30. }
  31. protected onDestroy(): void {
  32. this.onList1 = null;
  33. this.onList2 = null;
  34. }
  35. }