代码清理
This commit is contained in:
@@ -6,12 +6,10 @@ import {
|
||||
Vec3,
|
||||
tween,
|
||||
UITransform,
|
||||
path,
|
||||
view,
|
||||
} from "cc";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import { ViewManager } from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import { DataId, DataManager } from "../../data/DataManager";
|
||||
import { GirlData } from "../../data/GirlData";
|
||||
import { EnvData } from "../../data/EnvData";
|
||||
@@ -56,7 +54,7 @@ export class ImagePopup extends Component {
|
||||
*/
|
||||
private getOnscreenPosition(): Vec3 {
|
||||
const visibleSize = view.getVisibleSize();
|
||||
const x = -visibleSize.width/2 + 100; // 从左边缘向内100像素
|
||||
const x = -visibleSize.width / 2 + 100; // 从左边缘向内100像素
|
||||
const y = visibleSize.height * 0.33; // 屏幕高度的1/3处
|
||||
return new Vec3(x, y, 0);
|
||||
}
|
||||
@@ -73,20 +71,12 @@ export class ImagePopup extends Component {
|
||||
const envData = DataManager.I.getDataById<EnvData>(DataId.Env);
|
||||
let oldPath = url + (clear ? "" : "_thumbnail_blur");
|
||||
let suffix = clear ? ".png" : ".jpg";
|
||||
let newPath = envData.cdn + "/" + "Girls/" + oldPath + suffix;
|
||||
ResManager.I.changeRemoteSpriteFrame(
|
||||
this.image,
|
||||
newPath,
|
||||
() => {
|
||||
let sizeTran = this.image.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(
|
||||
sizeTran.contentSize,
|
||||
this.image.node,
|
||||
2
|
||||
);
|
||||
this.popUp();
|
||||
}
|
||||
);
|
||||
let newPath = envData.cdn + "/" + "Girls/" + oldPath + suffix;
|
||||
ResManager.I.changeRemoteSpriteFrame(this.image, newPath, () => {
|
||||
let sizeTran = this.image.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize, this.image.node, 2);
|
||||
this.popUp();
|
||||
});
|
||||
}
|
||||
|
||||
refreshSelf() {
|
||||
|
||||
Reference in New Issue
Block a user