[add] Engine
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import ScreenResize from "../ScreenResize";
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass("SwitchActive")
|
||||
export class SwitchActive {
|
||||
@property({ type: cc.Node })
|
||||
public UI: cc.Node = null;
|
||||
@property({ type: cc.Boolean/*, visible: function (this: ImageGroup) { return this.Reset; } */ })
|
||||
public show: boolean[] = [];
|
||||
|
||||
public SetObjActive(obj: cc.Node, show: boolean): void {
|
||||
obj.active = show;
|
||||
}
|
||||
}
|
||||
@ccclass
|
||||
export default class SwitchActiveGroup extends cc.Component {
|
||||
@property({ displayName: "縮放scale群組", type: SwitchActive })
|
||||
public ScaleGroups: SwitchActive[] = [];
|
||||
public Run(): void {
|
||||
if (this.ScaleGroups != null && this.ScaleGroups.length) {
|
||||
for (let group of this.ScaleGroups) {
|
||||
group.SetObjActive(group.UI, group.show[ScreenResize.IsPortrait]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user