创建项目

This commit is contained in:
2025-05-07 20:19:12 +08:00
commit e34b7addfb
103 changed files with 101649 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
.DS_Store
temp
library
local
release
node_modules
bin/js/bundles

15
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "LayaAir Debug",
"url": "http://localhost:18090",
"webRoot": "${workspaceFolder}/bin"
}
]
}

9
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,9 @@
{
"files.exclude": {
"**/.DS_Store": true,
"**/*.meta": true,
"library/": true,
"temp/": true,
"local/": true
}
}

10
assets/Scene.ls Normal file
View File

@@ -0,0 +1,10 @@
{
"_$ver": 1,
"_$id": "lx8mwule",
"_$type": "Scene",
"left": 0,
"right": 0,
"top": 0,
"bottom": 0,
"name": "Scene2D"
}

3
assets/Scene.ls.meta Normal file
View File

@@ -0,0 +1,3 @@
{
"uuid": "9b931ecf-fde9-44dd-acf3-15f8dc807965"
}

View File

@@ -0,0 +1,12 @@
{
"perFolder": true,
"includeSubFolders": true,
"maxWidth": 2048,
"maxHeight": 2048,
"eachMaxWidth": 512,
"eachMaxHeight": 512,
"format": 0,
"scale": 1,
"pot": false,
"trimImage": true
}

View File

@@ -0,0 +1,3 @@
{
"uuid": "796f02a6-37c1-451b-82b3-434e53a64447"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "60a9086c-a9c2-4e01-a563-355c117b509e",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,14 @@
{
"uuid": "d4cfd6a8-0d0a-475b-ac93-d85eaa646936",
"importer": {
"textureType": 2,
"sizeGrid": [
10,
14,
14,
16,
0
],
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,7 @@
{
"uuid": "55da1537-1ec8-4cdf-9b6f-f0d4af0431b0",
"importer": {
"textureType": 2,
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,7 @@
{
"uuid": "f0c051af-cf42-4abc-82e4-59f42ac888ee",
"importer": {
"textureType": 2,
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "e3cd8344-3bd6-4059-b771-a0ea99f96aad",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "d58d2a39-1cb4-49a1-a4fa-0664f5265e1a",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "6aa5b064-ff17-4273-a317-9778b9f4f67a",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "e1e83785-4a8e-42a5-a8ac-51d5ff2cb436",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -0,0 +1,14 @@
{
"uuid": "f64d4387-f2c7-4e48-bea1-a0dfd22a109d",
"importer": {
"textureType": 2,
"sizeGrid": [
0,
74,
0,
17,
0
],
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "2f7b7200-e363-4ffc-b9a4-62437a2302ab",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "d24c1cbc-0657-41fa-a966-471705de2af1",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,14 @@
{
"uuid": "5344e14f-1c62-43c8-a00a-5593ca19bdbf",
"importer": {
"textureType": 2,
"stateNum": 3,
"sizeGrid": [
10,
10,
10,
10,
0
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,7 @@
{
"uuid": "34582d14-0e49-41c3-9bac-3d12def95ef9",
"importer": {
"textureType": 2,
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,7 @@
{
"uuid": "679b3902-4c06-412d-aeef-7efca529bf41",
"importer": {
"textureType": 2,
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,13 @@
{
"uuid": "59679c29-d461-4664-be07-bc2bd95e4360",
"importer": {
"textureType": 2,
"sizeGrid": [
9,
9,
9,
9,
0
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,7 @@
{
"uuid": "35922f9e-69f5-4993-b37e-dbfc1504aece",
"importer": {
"textureType": 2,
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,13 @@
{
"uuid": "051feaa7-15db-4143-958c-161475961a6b",
"importer": {
"textureType": 2,
"sizeGrid": [
9,
9,
9,
9,
0
]
}
}

BIN
assets/atlas/comp/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "c13c1b8e-c516-4a0f-98ad-e356f45f0365",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "3225dc27-5bcb-446e-8b66-27df87624835",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "b86ab1e4-4348-47f0-96e7-771387714bfc",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "1fc7a268-7071-4e5d-88be-a125afa0e2c8",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "dda0809b-cfe4-41b3-a392-8bd79c456ee1",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "8daa4e1f-cba7-4117-b0d3-eb5c7ad9eefa",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,6 @@
{
"uuid": "2123a790-201a-4900-8885-b7ef9a27cfba",
"importer": {
"textureType": 2
}
}

BIN
assets/atlas/comp/label.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 B

View File

@@ -0,0 +1,6 @@
{
"uuid": "5c14adcd-87f9-4670-b165-7a77a56f3e00",
"importer": {
"textureType": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,13 @@
{
"uuid": "0128a93d-b244-40e4-bc90-48a93a3d87a2",
"importer": {
"textureType": 2,
"sizeGrid": [
0,
18,
0,
23,
0
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,13 @@
{
"uuid": "ae3de75e-ee9f-478d-9f8b-ede75a4fc296",
"importer": {
"textureType": 2,
"sizeGrid": [
0,
21,
0,
17,
0
]
}
}

BIN
assets/atlas/comp/radio.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,7 @@
{
"uuid": "41488331-0ed3-4c38-959b-6ecc4fdac7e6",
"importer": {
"textureType": 2,
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,7 @@
{
"uuid": "7db29ccb-50d2-461e-9b1c-8479ff20673f",
"importer": {
"textureType": 2,
"stateNum": 3
}
}

BIN
assets/atlas/comp/tab.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,14 @@
{
"uuid": "c7ce584a-c256-462a-aa94-a9905f7185aa",
"importer": {
"textureType": 2,
"sizeGrid": [
0,
28,
0,
24,
0
],
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,12 @@
{
"uuid": "9eb4836d-78c4-4be3-aa53-70a613fef28d",
"importer": {
"textureType": 2,
"sizeGrid": [
10,
12,
10,
12
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,12 @@
{
"uuid": "87262606-4dfe-490e-8644-7fd6496c2be7",
"importer": {
"textureType": 2,
"sizeGrid": [
10,
12,
10,
12
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,14 @@
{
"uuid": "d79c761b-6bc3-49e0-9e51-bd2ba385cfe0",
"importer": {
"textureType": 2,
"stateNum": 3,
"sizeGrid": [
10,
10,
10,
10,
0
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,7 @@
{
"uuid": "a62dfa59-dd5c-491c-8d7a-346205a51a5b",
"importer": {
"textureType": 2,
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,7 @@
{
"uuid": "c1da2147-6391-438e-a9a3-6f2dfb6b32d3",
"importer": {
"textureType": 2,
"stateNum": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,13 @@
{
"uuid": "fc3bb457-8d97-4456-b6b6-304c6b064689",
"importer": {
"textureType": 2,
"sizeGrid": [
11,
9,
11,
9,
0
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,14 @@
{
"uuid": "80000f74-4f4f-4c1c-bb95-49b2cc94c28d",
"importer": {
"textureType": 2,
"stateNum": 3,
"sizeGrid": [
10,
10,
10,
10,
0
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,13 @@
{
"uuid": "a9debde7-d669-4b6a-baae-ca10374f427f",
"importer": {
"textureType": 2,
"sizeGrid": [
9,
9,
9,
9,
0
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -0,0 +1,8 @@
{
"uuid": "c95ef96a-e095-434f-95a4-58156890681f",
"importer": {
"textureType": 2,
"sRGB": true,
"generateMipmap": true
}
}

1595
engine/types/Blueprint.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

71386
engine/types/LayaAir.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

2683
engine/types/box2d.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

1210
engine/types/cannon.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

295
engine/types/editor-client.d.ts vendored Normal file
View File

@@ -0,0 +1,295 @@
export { };
declare global {
export namespace IEditorClient {
export const ShaderTypePrefix = "Shader.";
export type DefaultValueComparator = (value: any) => boolean;
export const TypedArrayClasses: Record<string, any> = {
"Int8Array": Int8Array,
"Uint8Array": Uint8Array,
"Int16Array": Int16Array,
"Uint16Array": Uint16Array,
"Int32Array": Int32Array,
"Uint32Array": Uint32Array,
"Float32Array": Float32Array
};
export type TypeMenuItem = { type: FTypeDescriptor, label: string, icon: string };
export interface ITypeRegistry {
readonly types: Readonly<Record<string, FTypeDescriptor>>;
readonly scriptNameToID: Readonly<Record<string, string>>;
nodeTypeName: string;
componentTypeName: string;
setAllTypes(types: Record<string, FTypeDescriptor>): void;
isDerivedOf(type: string, baseType: string): boolean;
isNodeType(type: string): boolean;
getNodeBaseType(type: string): string;
getRequireComponents(nodeType: string): Array<string>;
getAllPropsOfType(type: FTypeDescriptor): Readonly<Record<string, FPropertyDescriptor>>;
getInitProps(typeDef: FTypeDescriptor): any;
getDefaultValue(typeDef: FTypeDescriptor, includePrivate?: boolean): any;
getPropDefaultValue(prop: FPropertyDescriptor): any;
getDefaultValueComparators(typeDef: FTypeDescriptor): Readonly<Record<string, DefaultValueComparator>>;
}
export enum IPCKey {
CreateNode = 'CreateNode',
InstantiatePrefab = 'InstantiatePrefab',
DestroyNode = 'DestroyNode',
NodeChanged = 'NodeChanged',
NodeFeaturesChanged = 'NodeStatusChanged',
GetNodeChildren = 'GetNodeChildren',
GetNode = 'GetNode',
SyncNodeProps = 'SyncNodeProps',
NodeChildrenChanged = 'NodeChildrenChanged',
ResetNodeChildren = 'ResetNodeChildren',
SelectionChanged = 'SelectionChanged',
AddComponent = 'AddComponent',
ReloadTypes = 'ReloadComponentTypes',
RunScript = "RunScript",
CopyNodes = 'CopyNodes',
PasteNodes = 'PasteNodes',
DuplicateNodes = 'DuplicateNodes',
CreatePrefab = 'CreatePrefab',
FindNodes = 'FindNodes',
GetResourceProps = "GetResourceProps",
ResourceChanged = "ResourceChanged",
SendMessageToPanel = 'SendMessageToPanel',
PostMessageToPanel = 'PostMessageToPanel',
}
export interface IMyScene {
readonly allNodes: Map<string, WeakRef<IMyNode>>;
readonly allResources: Map<string, WeakRef<any>>;
start(): Promise<void>;
getNodeById(id: string): IMyNode;
registerNode(node: IMyNode): void;
findNodes(keyword: string, maxResults?: number): Promise<Array<any>>;
setProps(obj: IMyNode | IMyComponent, datapath: ReadonlyArray<string>, value: any): Promise<boolean>;
setResProps(obj: any, datapath: ReadonlyArray<string>, value: any): Promise<boolean>;
getProps(obj: any): any;
sendChildChanged(node: IMyNode): void;
sendNameChanged(node: IMyNode, newName: string): void;
sendFeaturesChanged(node: IMyNode): void;
}
export enum NodeFeatures {
HasChild = 1,
RootNode = 2,
Inactive = 4,
InPrefab = 8,
IsPrefab = 16,
IsPrefabNewAdded = 32,
IsTopPrefab = 64,
IsPrefabReadonly = 128,
HideByEditor = 1024,
LockByEditor = 2048,
PrefabMissing = 4096,
}
export interface IMyNodeExtra {
id?: string;
type?: string;
selected?: boolean;
scene?: IMyScene;
}
export interface IMyNode {
hideFlags: number;
name: string;
readonly parent: IMyNode;
readonly destroyed: boolean;
readonly numChildren: number;
getChildAt(index: number): IMyNode;
isAncestorOf(node: IMyNode): boolean;
hasHideFlag(flag: number): boolean;
_setBit(type: number, value: boolean): void;
_getBit(type: number): boolean;
_extra: IMyNodeExtra;
}
export interface IMyComponent {
readonly owner: IMyNode;
hideFlags: number;
enabled: boolean;
}
export namespace MyMessagePortStatic {
/**
* It is used inside the webview or iframe to create a communication channel with the host.
* @param queueTask Whether to queue the task. If true, the received messages will be queued and processed sequentially. Defaults to false.
* @returns The message port.
*/
function requestFromHost(queueTask?: boolean): Promise<IMyMessagePort>;
/**
* Connect to a named service.
* @param serviceName Service name.
* @param subscribe Whether to receive broadcast messages from the service. Defaults to false.
* @param args Arguments to pass to the service.
* @returns The message port.
*/
function connectService(serviceName: string, subscribe?: boolean, ...args: any[]): IMyMessagePort;
}
export interface IMyMessagePort {
/**
* A delegate that is called when the port is closed.
*/
readonly onClose: IDelegate<() => void>;
/**
* Whether to log an error to the console when a received message does not have a corresponding handler function.
*/
logHandlerMissing: boolean;
/**
* Start the message port.
*
* This function only needs to be called when manually constructing a MyMessagePort object. In other cases, such as the object returned by connectService, it does not need to be called.
*/
start(): void;
/**
* Close the message port.
*/
close(): void;
/**
* Register a handler function for a channel.
* @param channel Channel name.
* @param func Handler function.
* @param thisArg The this object to bind the handler function to.
* @param noAwait If true, the handler function will not be awaited. Defaults to false.
*/
handle(channel: string, func: (...args: any[]) => Promise<any> | any, thisArg?: any, noAwait?: boolean): void;
/**
* Send a message to the other side.
* @param channel Channel name.
* @param args Arguments.
*/
send(channel: string, ...args: any[]): void;
/**
* Send a message to the other side and transfer some Transferable objects.
* @param channel Channel name.
* @param transfer Transferable objects.
* @param args Arguments.
*/
transfer(channel: string, transfer: Transferable[], ...args: any[]): void;
/**
* Send a message to the other side and expect a response.
* @param channel Channel name.
* @param args Arguments.
* @returns The response.
*/
invoke(channel: string, ...args: any[]): Promise<any>;
/**
* Manually call a handler function.
* @param channel Channel name.
* @param args Arguments.
* @returns The response.
*/
callHandler(channel: string, ...args: any[]): Promise<any>;
}
export interface IEditorClientSingleton {
readonly port: IMyMessagePort;
readonly scene: IMyScene;
readonly typeRegistry: ITypeRegistry;
addStartCallback(callback: () => void | Promise<void>): void;
sendMessageToPanel(panelId: string, cmd: string, ...args: Array<any>): Promise<any>;
postMessageToPanel(panelId: string, cmd: string, ...args: Array<any>): Promise<void>;
runUIScript(command: string, ...args: any[]): Promise<any>;
}
/**
* A delegate that can be used to manage multiple callbacks.
*/
export interface IDelegate<T extends (...args: any[]) => any> {
/**
* By default, callbacks will be executed directly. Unless this property is set, the delegate will use this method to execute the callback.
* @param method The method to execute.
* @param thisArg The this argument of the method.
* @param args The arguments of the method.
*/
executor: (method: Function, thisArg: any, ...args: any[]) => void;
/**
* Add a callback.
* @param callback The callback to add.
* @param target The this argument of the callback.
*/
add(callback: T, target?: any): void;
/**
* Add a run-once callback.
* @param callback The callback to add.
* @param target The this argument of the callback.
*/
once(callback: T, target?: any): void;
/**
* Remove a callback.
* @param callback The callback to remove.
* @param target The this argument of the callback.
*/
remove(callback: T, target?: any): void;
/**
* Clear all callbacks.
*/
clear(): void;
/**
* Clear callbacks for a specific target.
* @param target The this argument of the callbacks to clear.
*/
clearForTarget(target: any): void;
/**
* Clear callbacks that meet a specific condition.
* @param test The test function. Return true to clear the callback.
*/
clearFor(test: (target: any, callback: T) => boolean): void;
/**
* Count of the callbacks.
*/
readonly count: number;
/**
* Execute the callbacks immediately.
* @param args Arguments of the callbacks.
*/
invoke(...args: Parameters<T>): void;
}
/**
* The `MyMessagePort` class is used to create a message port object.
*
* A message port is a communication channel that allows two different processes to communicate with each other.
* @param port The native message port.
* @param queueTask Whether to queue the task. If true, the received messages will be queued and processed sequentially. Defaults to false.
* @see IMyMessagePort
* @see MyMessagePortStatic
*/
const MyMessagePort: (new (port: MessagePort, queueTask?: boolean) => IMyMessagePort) & typeof MyMessagePortStatic;
}
var EditorClient: IEditorClient.IEditorClientSingleton;
}

8903
engine/types/editor-env.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

3006
engine/types/editor-ui.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

9497
engine/types/editor.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

19
engine/types/glsl.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
declare module '*.glsl' {
const value: string
export default value
}
declare module '*.vs' {
const value: string
export default value
}
declare module '*.fs' {
const value: string
export default value
}
declare module '*.wgsl' {
const value: string
export default value
}

1320
engine/types/layaAir.minigame.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

1269
engine/types/spine.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
{
"name": "LayaProject1",
"startupScene": "res://9b931ecf-fde9-44dd-acf3-15f8dc807965"
}

View File

@@ -0,0 +1,11 @@
{
"textureType": 2,
"layers": [
"Default",
"Layer1",
"Layer2",
"Layer3",
"Layer4",
"Layer5"
]
}

View File

@@ -0,0 +1,6 @@
{
"modules": {
"laya.ui": true,
"laya.d3": true
}
}

3
shudu.laya Normal file
View File

@@ -0,0 +1,3 @@
{
"version": "3.2.5"
}

Some files were not shown because too many files have changed in this diff Show More