This commit is contained in:
2024-10-05 04:22:34 +08:00
parent 5993f231fd
commit 30911fcf5c
298 changed files with 28632 additions and 28632 deletions

View File

@@ -1,36 +1,36 @@
import { Component, Node, Prefab, _decorator, instantiate } from 'cc'
import PrefabLoader from '../../engine/utils/PrefabLoader'
import { GameConfig } from '../config/GameConfig'
const { ccclass, property } = _decorator
@ccclass('ResourcePrefab')
export default class ResourcePrefab extends Component {
private static prefab: Prefab | null = null
public static instance: Node
@property({ type: Prefab })
private scorePrefab: Prefab | null = null
public static preLoad(): Promise<void> {
return new Promise((resolve, reject) => {
PrefabLoader.loadPrefab(
`${GameConfig.GameName}/game/prefab/ResourcePrefab`,
(loadedResource: Prefab) => {
ResourcePrefab.prefab = loadedResource
ResourcePrefab.instance = instantiate(loadedResource)
resolve()
},
)
})
}
public static clear() {
ResourcePrefab.instance = null
ResourcePrefab.prefab = null
}
public static getScorePrefab() {
return ResourcePrefab.instance.getComponent(ResourcePrefab).scorePrefab
}
}
import { Component, Node, Prefab, _decorator, instantiate } from 'cc'
import PrefabLoader from '../../engine/utils/PrefabLoader'
import { GameConfig } from '../config/GameConfig'
const { ccclass, property } = _decorator
@ccclass('ResourcePrefab')
export default class ResourcePrefab extends Component {
private static prefab: Prefab | null = null
public static instance: Node
@property({ type: Prefab })
private scorePrefab: Prefab | null = null
public static preLoad(): Promise<void> {
return new Promise((resolve, reject) => {
PrefabLoader.loadPrefab(
`${GameConfig.GameName}/game/prefab/ResourcePrefab`,
(loadedResource: Prefab) => {
ResourcePrefab.prefab = loadedResource
ResourcePrefab.instance = instantiate(loadedResource)
resolve()
},
)
})
}
public static clear() {
ResourcePrefab.instance = null
ResourcePrefab.prefab = null
}
public static getScorePrefab() {
return ResourcePrefab.instance.getComponent(ResourcePrefab).scorePrefab
}
}

View File

@@ -1,11 +1,11 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "e0c999fe-5635-4caa-8c3b-d16793848320",
"files": [],
"subMetas": {},
"userData": {
"simulateGlobals": []
}
}
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "e0c999fe-5635-4caa-8c3b-d16793848320",
"files": [],
"subMetas": {},
"userData": {
"simulateGlobals": []
}
}

View File

@@ -1,27 +1,27 @@
import { Component, Label, Tween, Vec2, Vec3, _decorator, tween } from 'cc'
const { ccclass, property } = _decorator
@ccclass('ScorePrefab')
export default class ScorePrefab extends Component {
@property({ type: Label })
private txtScore: Label | null = null
public init(score: number) {
if (score <= 0) this.txtScore.string = 'Miss'
else this.txtScore.string = `${score}`
}
public playMoveEffect(p: Vec2, callback: Function = null) {
tween(this.node)
.to(0.5, { scale: new Vec3(3, 3, 3), position: new Vec3(p.x, p.y, 0) })
.call(() => {
if (callback) callback()
})
.start()
}
onDisable() {
Tween.stopAllByTarget(this.node)
}
}
import { Component, Label, Tween, Vec2, Vec3, _decorator, tween } from 'cc'
const { ccclass, property } = _decorator
@ccclass('ScorePrefab')
export default class ScorePrefab extends Component {
@property({ type: Label })
private txtScore: Label | null = null
public init(score: number) {
if (score <= 0) this.txtScore.string = 'Miss'
else this.txtScore.string = `${score}`
}
public playMoveEffect(p: Vec2, callback: Function = null) {
tween(this.node)
.to(0.5, { scale: new Vec3(3, 3, 3), position: new Vec3(p.x, p.y, 0) })
.call(() => {
if (callback) callback()
})
.start()
}
onDisable() {
Tween.stopAllByTarget(this.node)
}
}

View File

@@ -1,11 +1,11 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "465f63cc-b6fe-4ea9-9a10-79254fbe67cc",
"files": [],
"subMetas": {},
"userData": {
"simulateGlobals": []
}
}
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "465f63cc-b6fe-4ea9-9a10-79254fbe67cc",
"files": [],
"subMetas": {},
"userData": {
"simulateGlobals": []
}
}

View File

@@ -1,50 +1,50 @@
import { Component, Material, Node, Prefab, _decorator, instantiate } from 'cc'
import PrefabLoader from '../../engine/utils/PrefabLoader'
import { GameConfig } from '../config/GameConfig'
const { ccclass, property } = _decorator
@ccclass('ShaderMaterialPrefab')
export default class ShaderMaterialPrefab extends Component {
public static instance: Node
@property({ type: Material })
public default: Material | null = null
@property({ type: Material })
public grayMaterial: Material | null = null
@property({ type: Material })
public oldPhoto: Material | null = null
@property({ type: Material })
public glowInner: Material | null = null
@property({ type: Material })
public mosaic: Material | null = null
@property({ type: Material })
public roundCornerCrop: Material | null = null
@property({ type: Material })
public flashLight: Material | null = null
@property({ type: Material })
public flag: Material | null = null
@property({ type: Material })
public gaussian: Material | null = null
public static preLoad(): Promise<void> {
return new Promise((resolve, reject) => {
PrefabLoader.loadPrefab(
`${GameConfig.GameName}/game/prefab/ShaderMaterialPrefab`,
(loadedResource: Prefab) => {
ShaderMaterialPrefab.instance = instantiate(loadedResource)
resolve()
},
)
})
}
}
import { Component, Material, Node, Prefab, _decorator, instantiate } from 'cc'
import PrefabLoader from '../../engine/utils/PrefabLoader'
import { GameConfig } from '../config/GameConfig'
const { ccclass, property } = _decorator
@ccclass('ShaderMaterialPrefab')
export default class ShaderMaterialPrefab extends Component {
public static instance: Node
@property({ type: Material })
public default: Material | null = null
@property({ type: Material })
public grayMaterial: Material | null = null
@property({ type: Material })
public oldPhoto: Material | null = null
@property({ type: Material })
public glowInner: Material | null = null
@property({ type: Material })
public mosaic: Material | null = null
@property({ type: Material })
public roundCornerCrop: Material | null = null
@property({ type: Material })
public flashLight: Material | null = null
@property({ type: Material })
public flag: Material | null = null
@property({ type: Material })
public gaussian: Material | null = null
public static preLoad(): Promise<void> {
return new Promise((resolve, reject) => {
PrefabLoader.loadPrefab(
`${GameConfig.GameName}/game/prefab/ShaderMaterialPrefab`,
(loadedResource: Prefab) => {
ShaderMaterialPrefab.instance = instantiate(loadedResource)
resolve()
},
)
})
}
}

View File

@@ -1,11 +1,11 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "7c56c670-6b06-4cf1-a606-7af6226a3cb6",
"files": [],
"subMetas": {},
"userData": {
"simulateGlobals": []
}
}
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "7c56c670-6b06-4cf1-a606-7af6226a3cb6",
"files": [],
"subMetas": {},
"userData": {
"simulateGlobals": []
}
}