加载远程资源
This commit is contained in:
@@ -16,6 +16,8 @@ import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import { ViewManager } from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import { GButton } from "db://assets/Scripts/Main/Common/GButton";
|
||||
import { SceneBgVideoLayer } from "../../../Sub/UI/SceneBgVideoLayer";
|
||||
import { DataManager, DataId } from "../../data/DataManager";
|
||||
import { EnvData } from "../../data/EnvData";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
interface ShowPanelData {
|
||||
@@ -67,8 +69,14 @@ export class ShowPanel extends li_BaseView {
|
||||
}
|
||||
|
||||
show(path: string) {
|
||||
const envData = DataManager.I.getDataById<EnvData>(DataId.Env);
|
||||
if (this.isImg) {
|
||||
ResManager.I.changeBundleSpriteFrame(this.image, path, "Girls", () => {
|
||||
// ResManager.I.changeBundleSpriteFrame(this.image, path, "Girls", () => {
|
||||
// Utils.adjustBgPixelRatio(this.image.node, 3);
|
||||
// });
|
||||
// 加载远程资源
|
||||
let newPath = envData.cdn + "/" + "Girls/" + path + ".png";
|
||||
ResManager.I.changeRemoteSpriteFrame(this.image, newPath, () => {
|
||||
Utils.adjustBgPixelRatio(this.image.node, 3);
|
||||
});
|
||||
} else {
|
||||
@@ -77,11 +85,11 @@ export class ShowPanel extends li_BaseView {
|
||||
const targetSize = this.videoArea
|
||||
? new Size(this.videoArea.width, this.videoArea.height)
|
||||
: new Size(600, 800);
|
||||
|
||||
ResManager.I.changeBundleVideo(
|
||||
// 加载远程资源
|
||||
let newPath = envData.cdn + "/" + "Girls/" + path + ".mp4";
|
||||
ResManager.I.loadRemoteVideo(
|
||||
this.videoPlayer,
|
||||
path,
|
||||
"Girls",
|
||||
newPath,
|
||||
(res: VideoClip) => {
|
||||
// 设置视频大小和位置
|
||||
const uiTransform = this.videoPlayer.node.getComponent(UITransform);
|
||||
|
||||
@@ -17,6 +17,7 @@ import { GirlDetailPanel } from "../ui/panels/GirlDetailPanel";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
import { DataManager, DataId } from "../data/DataManager";
|
||||
import { GirlData } from "../data/GirlData";
|
||||
import { EnvData } from "../data/EnvData";
|
||||
import { TipsPanel } from "../ui/panels/TipsPanel";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
@@ -204,7 +205,16 @@ export class DetailImageItem extends Component {
|
||||
imgPath = this.url + "_thumbnail_blur";
|
||||
}
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Girls", () => {
|
||||
// ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Girls", () => {
|
||||
// this.question.active = false;
|
||||
// this.scaleToFillItem();
|
||||
// this.loading.active = false;
|
||||
// });
|
||||
|
||||
// 加载远程资源
|
||||
const envData = DataManager.I.getDataById<EnvData>(DataId.Env);
|
||||
let newPath = envData.cdn + "/" + "Girls/" + imgPath + ".jpg";
|
||||
ResManager.I.changeRemoteSpriteFrame(this.img, newPath, () => {
|
||||
this.question.active = false;
|
||||
this.scaleToFillItem();
|
||||
this.loading.active = false;
|
||||
@@ -216,7 +226,15 @@ export class DetailImageItem extends Component {
|
||||
this.priceFrame.active = false;
|
||||
this.isVisible = true;
|
||||
const imgPath = this.url + "_thumbnail";
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Girls", () => {
|
||||
// ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Girls", () => {
|
||||
// this.question.active = false; // 图片加载成功后隐藏问号
|
||||
// this.scaleToFillItem();
|
||||
// });
|
||||
|
||||
// 加载远程资源
|
||||
const envData = DataManager.I.getDataById<EnvData>(DataId.Env);
|
||||
let newPath = envData.cdn + "/" + "Girls/" + imgPath + ".jpg";
|
||||
ResManager.I.changeRemoteSpriteFrame(this.img, newPath, () => {
|
||||
this.question.active = false; // 图片加载成功后隐藏问号
|
||||
this.scaleToFillItem();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user