新ui入版
This commit is contained in:
@@ -6,9 +6,6 @@ const { ccclass, property } = _decorator;
|
||||
export class SimpleToggleGroup extends Component {
|
||||
toggles: SimpleToggle[];
|
||||
|
||||
@property(Node)
|
||||
slider: Node;
|
||||
|
||||
protected onLoad(): void {
|
||||
this.toggles = this.getComponentsInChildren(SimpleToggle);
|
||||
|
||||
@@ -19,12 +16,6 @@ export class SimpleToggleGroup extends Component {
|
||||
}
|
||||
|
||||
toggleSelected(selectedNode: Node) {
|
||||
const pos = this.slider.getPosition();
|
||||
const targetPos = new Vec3(selectedNode.getPosition().x, pos.y, pos.z);
|
||||
tween(this.slider)
|
||||
.to(0.3, { position: targetPos }, { easing: "sineInOut" })
|
||||
.start();
|
||||
|
||||
for (let i = 0; i < this.toggles.length; i++) {
|
||||
const element = this.toggles[i];
|
||||
if (element.node === selectedNode) {
|
||||
|
||||
Reference in New Issue
Block a user