UpdateLayer.ts 481 B

12345678910111213141516171819202122
  1. import { _decorator, Component, Label, Node } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('UpdateLayer')
  4. export class UpdateLayer extends Component {
  5. public static instance:UpdateLayer=null;
  6. start() {
  7. UpdateLayer.instance=this;
  8. this.node.getComponent(Label).string='1';
  9. }
  10. update(deltaTime: number) {
  11. }
  12. public Update_Layer(layer:number){
  13. this.node.getComponent(Label).string=layer.toString();
  14. }
  15. }