yantar/assets/Scripts/ui/ToggleManage.ts
Georgy Shive f7de182009 обновил модель, добавил кнопки для отображения/скрытия списка оборудования
добавил тогглер для переключения видимости стен
добавил список оборудования ( пустой)
обновил 3D модель
2025-02-05 17:33:06 +07:00

28 lines
701 B
TypeScript

import { _decorator, Color, Component, Label, Node, Sprite } from "cc";
const { ccclass, property } = _decorator;
@ccclass("ToggleManage")
export class ToggleManage extends Component {
@property(Node) nodeThump: Node = null!;
@property(Sprite) spriteBg: Sprite = null!;
@property(Color) colorBg: Color[] = [];
isOnToggle: boolean = false;
start() {
this.spriteBg.color = this.colorBg[0];
}
setToggle() {
if (this.isOnToggle) {
this.isOnToggle = false;
this.spriteBg.color = this.colorBg[0];
} else {
this.isOnToggle = true;
this.spriteBg.color = this.colorBg[1];
}
this.nodeThump.setPosition((0 - this.nodeThump.position.x), 0, 0);
}
}