ColorDate.ts 643 B

1234567891011121314151617181920212223242526272829303132
  1. import { _decorator, Component, Node } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('ColorDate')
  4. export class ColorDate {
  5. r:number;
  6. g:number;
  7. b:number;
  8. id:number;
  9. /**
  10. * 生产一个颜色对象
  11. * @param r
  12. * @param g
  13. * @param b
  14. * @param id
  15. * @returns
  16. */
  17. public static new_bean(r:number,g:number,b:number,id:number){
  18. let ret = new ColorDate();
  19. ret.r = r;
  20. ret.g = g;
  21. ret.b = b;
  22. ret.id = id;
  23. return ret;
  24. }
  25. public clone():ColorDate{
  26. return ColorDate.new_bean(this.r,this.g,this.b,this.id);
  27. }
  28. }