results_unlock_car.ts 645 B

1234567891011121314151617181920
  1. import { _decorator, Component, Node, Sprite } from 'cc';
  2. import { imageCacheManager } from '../manager/imageCacheManager';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('results_unlock_car')
  5. export class results_unlock_car extends Component {
  6. @property(Node) spr_car:Node = null
  7. public show(car_id:number){
  8. this.node.active = true
  9. this.spr_car.getComponent(Sprite).spriteFrame =null
  10. this.spr_car.getComponent(Sprite).spriteFrame = imageCacheManager.getHomeCarImageById(car_id)
  11. }
  12. public hide(){
  13. this.spr_car.getComponent(Sprite).spriteFrame =null
  14. this.node.active = false
  15. }
  16. }