[add] Engine

This commit is contained in:
2022-08-26 16:48:17 +08:00
parent f67e566f2a
commit d9c19f096c
197 changed files with 10626 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import ScreenResize from "../ScreenResize";
const { ccclass, property } = cc._decorator;
@ccclass("SwitchRotation")
export class SwitchRotation {
@property({ type: cc.Node })
public UI: cc.Node = null;
@property({ type: cc.Float/*, visible: function (this: ImageGroup) { return this.Reset; } */ })
public rotaitonNum: number[] = [];
public SetObjRotation(obj: cc.Node, r: number): void {
obj.angle = -r;
}
}
@ccclass
export default class SwitchRotationGroup extends cc.Component {
@property({ displayName: "設定rotation群組", type: SwitchRotation })
public ScaleGroups: SwitchRotation[] = [];
public Run(): void {
if (this.ScaleGroups != null && this.ScaleGroups.length) {
for (let group of this.ScaleGroups) {
group.SetObjRotation(group.UI, group.rotaitonNum[ScreenResize.IsPortrait]);
}
}
}
}