This commit is contained in:
2025-07-25 15:20:02 +08:00
parent 2f6d583ebf
commit 1dba986ad7
26 changed files with 1989 additions and 759 deletions
+862 -478
View File
File diff suppressed because it is too large Load Diff
+12 -1
View File
@@ -1,6 +1,7 @@
import { _decorator, Component, EditBox, Node } from "cc";
import { _decorator, Component, EditBox, Node,Label } from "cc";
import { DemoManager } from "./DemoManager";
import { ChatGPTService } from "./ChatGPTService";
import {characters} from "db://assets/Scripts/test/cfg/characters";
const { ccclass, property } = _decorator;
@ccclass("ChatPanel")
@@ -10,6 +11,16 @@ export class ChatPanel extends Component {
@property(EditBox)
editBox: EditBox = null;
@property(Label)
girlName: Label = null;
id:number
refresh(id:number) {
this.id = id;
const data = characters[id-1];
this.girlName.string = data.name;
}
protected onEnable(): void {
if (!this.manager) this.manager = DemoManager.getInstance();
}
+23 -4
View File
@@ -1,6 +1,9 @@
import { find } from "cc";
import { ChatContentsLayout } from "./ChatContentsLayout";
import { DemoData } from "./DemoData";
import {GirlDetailPanel} from "db://assets/Scripts/test/GirlDetailPanel";
import {ChatPanel} from "db://assets/Scripts/test/ChatPanel";
import {GirlListPanel} from "db://assets/Scripts/test/girlListPanel/GirlListPanel";
export class DemoManager {
private static _instance: DemoManager;
@@ -18,15 +21,31 @@ export class DemoManager {
demoData: DemoData;
public layoutout: ChatContentsLayout;
public detailPanel:GirlDetailPanel;
public chatPanel:ChatPanel;
public girlListPanel:GirlListPanel;
EnterChat(id: number) {
find("Canvas/ChatPanel").active = true;
find("Canvas/GirlDetailPanel").active = false;
if(this.chatPanel==null)
{
this.chatPanel = find("Canvas/ChatPanel").getComponent(ChatPanel);
}
this.chatPanel.node.active = true;
this.detailPanel.node.active = false;
}
EnterDetail(id: number) {
find("Canvas/GirlListPanel").active = false;
find("Canvas/GirlDetailPanel").active = true;
if(this.girlListPanel==null)
{
this.girlListPanel =find("Canvas/GirlListPanel").getComponent(GirlListPanel);
}
this.girlListPanel.node.active = false;
if(this.detailPanel==null)
{
this.detailPanel = find("Canvas/GirlDetailPanel").getComponent(GirlDetailPanel);
}
this.detailPanel.refresh(id);
this.detailPanel.node.active = true;
}
public updateDialog(isPlayer: boolean, str: string) {
+8 -2
View File
@@ -1,5 +1,6 @@
import { _decorator, Component, Label, Node, Sprite } from "cc";
import { DemoManager } from "./DemoManager";
import {Character, characters} from "db://assets/Scripts/test/cfg/characters";
const { ccclass, property } = _decorator;
@ccclass("GirlDetailPanel")
@@ -14,8 +15,13 @@ export class GirlDetailPanel extends Component {
@property(Node)
chatBtn: Node;
id = 0;
start() {
this.id = 1;
refresh(index:number)
{
const data = characters[index-1];
this.girlName.string = data.name;
this.desc.string = data.description;
this.id = data.id;
}
OnClickChatBtn() {
DemoManager.getInstance().EnterChat(this.id);
+9
View File
@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "ad76166f-8498-40ba-95df-e36d36090bb9",
"files": [],
"subMetas": {},
"userData": {}
}
+25
View File
@@ -0,0 +1,25 @@
export interface Character {
id: number;
name: string;
age: number;
description: string;
}
export const characters: Character[] = [
{
id: 1,
name: "Anaya Kapoor",
age:24,
description: "🌸 Hi, I'm Anaya Kapoor, a 24-year-old dreamer from Mumbai. I blend tradition with trend — from vibrant saris to sleek streetwear, fashion is how I express my story.\n" +
"\n" +
"As a lifestyle influencer with over 1 million followers, I celebrate beauty in all its forms — skin, spirit, and self-love.\n" +
"\n" +
"I grew up watching Bollywood classics and dancing to every beat — now, I create my own rhythms with my camera, my words, and my smile.\n" +
"\n" +
"Coffee lover ☕ | Dancer 💃 | Proud Desi ✨\n" +
"\n" +
"Be your own kind of beautiful."
},
]
@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "5a025fba-6622-4b6d-9706-b09123b7c2ce",
"files": [],
"subMetas": {},
"userData": {}
}
@@ -8,6 +8,7 @@ import {
Sprite,
} from "cc";
import { DemoManager } from "../DemoManager";
import { Character, characters } from "db://assets/Scripts/test/cfg/characters";
const { ccclass, property } = _decorator;
@ccclass("GirlListItem")
@@ -24,19 +25,17 @@ export class GirlListItem extends Component {
chatBtn: Node;
id: number = -1;
start() {
// this.avatar = this.node
// .getChildByName("avatar/Avatar")
// .getComponent(Sprite);
// this.girlName = this.node.getChildByName("Desc/Name").getComponent(Label);
// this.desc = this.node.getChildByName("Desc/desc").getComponent(Label);
// this.price = this.node.getChildByName("purchase/price").getComponent(Label);
// this.chatBtn = this.node.getChildByName("purchase/Button");
this.id = 1;
protected onEnable(): void {
this.refreshData(1);
}
refreshData() {}
refreshData(index: number) {
const data = characters[index - 1];
this.id = data.id;
this.girlName.string = data.name;
//this.avatar.spriteFrame =
}
onClickDetail() {
DemoManager.getInstance().EnterDetail(this.id);
@@ -1,14 +1,17 @@
import { _decorator, Component, Node } from 'cc';
import {characters} from "db://assets/Scripts/test/cfg/characters";
const { ccclass, property } = _decorator;
@ccclass('GirlListPanel')
export class GirlListPanel extends Component {
start() {
onEnable()
{
const cfg = characters;
for (let i = 0; i < cfg.length; i++) {
const c = cfg[i];
}
update(deltaTime: number) {
}
}
Binary file not shown.
Binary file not shown.
+12
View File
@@ -0,0 +1,12 @@
{
"ver": "1.0.0",
"importer": "*",
"imported": true,
"uuid": "77a7f2c7-b92c-4bd7-888d-5dfe9b470b3c",
"files": [
".json",
".xlsx"
],
"subMetas": {},
"userData": {}
}
+9
View File
@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "a861708d-2bb1-403e-9c83-9f30dac2db1d",
"files": [],
"subMetas": {},
"userData": {}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

+134
View File
@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "b33e3b8b-7653-4b7d-a17a-8da09866653a",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "b33e3b8b-7653-4b7d-a17a-8da09866653a@6c48a",
"displayName": "1",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "b33e3b8b-7653-4b7d-a17a-8da09866653a",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "b33e3b8b-7653-4b7d-a17a-8da09866653a@f9941",
"displayName": "1",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 218,
"height": 218,
"rawWidth": 218,
"rawHeight": 218,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-109,
-109,
0,
109,
-109,
0,
-109,
109,
0,
109,
109,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
218,
218,
218,
0,
0,
218,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-109,
-109,
0
],
"maxPos": [
109,
109,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "b33e3b8b-7653-4b7d-a17a-8da09866653a@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "b33e3b8b-7653-4b7d-a17a-8da09866653a@6c48a"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "dd3dfa16-2f99-4b08-bd4c-b1b7d2577bc6",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "dd3dfa16-2f99-4b08-bd4c-b1b7d2577bc6@6c48a",
"displayName": "avatar_mask_cover",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "dd3dfa16-2f99-4b08-bd4c-b1b7d2577bc6",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "dd3dfa16-2f99-4b08-bd4c-b1b7d2577bc6@f9941",
"displayName": "avatar_mask_cover",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 120,
"height": 120,
"rawWidth": 120,
"rawHeight": 120,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-60,
-60,
0,
60,
-60,
0,
-60,
60,
0,
60,
60,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
120,
120,
120,
0,
0,
120,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-60,
-60,
0
],
"maxPos": [
60,
60,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "dd3dfa16-2f99-4b08-bd4c-b1b7d2577bc6@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "dd3dfa16-2f99-4b08-bd4c-b1b7d2577bc6@6c48a"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "0b9ea17a-dae1-42ae-b32f-1571d1658fa6",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "0b9ea17a-dae1-42ae-b32f-1571d1658fa6@6c48a",
"displayName": "listitem_edge",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "0b9ea17a-dae1-42ae-b32f-1571d1658fa6",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "0b9ea17a-dae1-42ae-b32f-1571d1658fa6@f9941",
"displayName": "listitem_edge",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 9,
"height": 222,
"rawWidth": 9,
"rawHeight": 222,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 3,
"borderRight": 2,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4.5,
-111,
0,
4.5,
-111,
0,
-4.5,
111,
0,
4.5,
111,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
222,
9,
222,
0,
0,
9,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4.5,
-111,
0
],
"maxPos": [
4.5,
111,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "0b9ea17a-dae1-42ae-b32f-1571d1658fa6@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "0b9ea17a-dae1-42ae-b32f-1571d1658fa6@6c48a"
}
}
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "adee00a4-d095-48c3-b84d-97a0504a7b3e",
"files": [],
"subMetas": {},
"userData": {}
}
+9
View File
@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "a4a8cb8c-a44e-4498-b500-8bde612e8d74",
"files": [],
"subMetas": {},
"userData": {}
}
Binary file not shown.
+12
View File
@@ -0,0 +1,12 @@
{
"ver": "1.0.0",
"importer": "video-clip",
"imported": true,
"uuid": "06ba55f7-af6a-4597-ab64-20e5534a6410",
"files": [
".json",
".mp4"
],
"subMetas": {},
"userData": {}
}
@@ -7,6 +7,16 @@ items:
isVariant: false
associations: []
_variants: []
character1Name:
key: character1Name
value: ""
type: 2
isVariant: false
associations:
- sceneUuid: 11f821b7-0408-4ecd-a1e3-b380e01cf759
nodeUuid: 01fPiGkxpJdYruegVxj88I
reference: 11f821b7-0408-4ecd-a1e3-b380e01cf759
_variants: []
languageConfig:
bcp47Tag: index
translateFinished: 0
@@ -2,7 +2,7 @@
"__version__": "1.0.1",
"L10nEnable": true,
"ProjectConfig": {
"localLanguage": "zh-Hant-TW",
"localLanguage": "en",
"scanOptions": [
{
"dirs": [