CubeConfig.ts 640 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { _decorator, Color, Component, Node } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('CubeConfig')
  4. export class CubeConfig {
  5. }
  6. export const IdToName: { [key: number]: string } = {
  7. 0:'redCube',
  8. 1:'blueCube',
  9. 2:'greenCube',
  10. 3:'yellowCube',
  11. };
  12. export const config={
  13. redCube:{
  14. id:0,
  15. color:Color.RED
  16. } as cube,
  17. blueCube:{
  18. id:1,
  19. color:Color.BLUE
  20. } as cube,
  21. greenCube:{
  22. id:2,
  23. color:Color.GREEN
  24. } as cube,
  25. yellowCube:{
  26. id:3,
  27. color:Color.YELLOW
  28. } as cube,
  29. }
  30. type cube={
  31. id:number,
  32. color:Color
  33. }