Cube_Infor.ts 605 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { _decorator, Component, Label, Node, RigidBody } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. export enum Cube_State{
  4. live,
  5. wait,
  6. dead
  7. }
  8. @ccclass('Cube_Infor')
  9. export class Cube_Infor extends Component {
  10. @property(Label)
  11. txt:Label;
  12. @property(RigidBody)
  13. rigidbody:RigidBody;
  14. text:string;
  15. // lock:boolean = false;
  16. state:Cube_State = Cube_State.live;
  17. start() {
  18. }
  19. update(deltaTime: number) {
  20. }
  21. set Text(value:string){
  22. this.txt.string = value;
  23. }
  24. get Text(){
  25. return this.txt.string;
  26. }
  27. }