初版 修补 单png 读取npk绘制 类 BaseSprite
This commit is contained in:
parent
b788650637
commit
4bb52cd5ac
|
|
@ -0,0 +1,31 @@
|
|||
import { _decorator, Component, Node, Animation, Sprite, resources, SpriteFrame, CCString, CCInteger, Vec2 } from 'cc';
|
||||
import { MyAnimation } from './MyAnimation';
|
||||
|
||||
const { ccclass, property, requireComponent, executeInEditMode } = _decorator;
|
||||
|
||||
@ccclass('BaseSprite')
|
||||
@requireComponent(Sprite)//依赖组件 精灵
|
||||
export default class BaseSprite extends MyAnimation {
|
||||
|
||||
AnimationFrameCount: number = 1;
|
||||
|
||||
@property({ type: CCString, displayName: '默认img路径', tooltip: "img路径" })
|
||||
DefaultImgPath: string = "";
|
||||
|
||||
ImgPath: string[] = ["", ""];
|
||||
|
||||
@property({ type: CCInteger, displayName: 'img编号', tooltip: "img编号" })
|
||||
_GImgIndex = 0;
|
||||
ImgIndex: number[] = [0, 0];
|
||||
|
||||
FrameDelay: Array<number> = [0, 9999999999];
|
||||
|
||||
@property({ type: [CCInteger], displayName: '是否显示', tooltip: "1为显示 0为不显示" })
|
||||
PlayState = 0;
|
||||
|
||||
on_GImgIndexChanged() {
|
||||
this.ImgIndex[1] = this._GImgIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "9258ddd0-5510-42fc-bf01-0b3888057cd3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
|
|
@ -136,6 +136,7 @@ export class MyAnimation extends Component {
|
|||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
//如果游戏世界处于暂停的模式下 不再继续播放
|
||||
if (GameState.getInstance().IsPauseState()) return;
|
||||
//如果初始化未完成,不播放
|
||||
|
|
@ -161,7 +162,7 @@ export class MyAnimation extends Component {
|
|||
// console.log(this.node);
|
||||
|
||||
//设置坐标
|
||||
this.node.setPosition(FrameObj.Pos);
|
||||
if (FrameObj.Pos) this.node.setPosition(FrameObj.Pos);
|
||||
|
||||
//重置计时器
|
||||
this.PlayTimer = 0;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ export class ScriptMyAnimation extends MyAnimation {
|
|||
|
||||
//判断是否有Als
|
||||
CheckAnimotionAls() {
|
||||
let Ret = GameScript.getInstance().GetDataByPath(this.AnimationPath + ".als");
|
||||
|
||||
let Ret = GameScript.getInstance().GetDataByPath("ani/001_1x2.ani.als");
|
||||
if (Ret) {
|
||||
console.log(Ret);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ class ScriptTree {
|
|||
GlobalTool.CrcDecode(RealBuf, FileObject.Cre32);
|
||||
|
||||
//Ani的处理逻辑
|
||||
if (Path.indexOf(".ani") != -1) {
|
||||
if (Path.indexOf(".ani") != -1 && Path.indexOf(".als") == -1) {
|
||||
// try {
|
||||
let Buf = this.Decompile_ani(RealBuf);
|
||||
this.ScriptFileData.set(Path, Buf);
|
||||
|
|
@ -221,6 +221,7 @@ class ScriptTree {
|
|||
try {
|
||||
let Buf = this.Decompile_script(RealBuf);
|
||||
this.ScriptFileData.set(Path, Buf);
|
||||
|
||||
return Buf;
|
||||
} catch (error) {
|
||||
// console.log(RealFilePath);
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "6f6bc927-ddff-4f20-82bd-1544ef9264b6",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB |
|
|
@ -1,134 +0,0 @@
|
|||
{
|
||||
"ver": "1.0.26",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "e2e7060f-3895-4c6c-964d-5e9e24fc932d",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "e2e7060f-3895-4c6c-964d-5e9e24fc932d@6c48a",
|
||||
"displayName": "man",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "e2e7060f-3895-4c6c-964d-5e9e24fc932d",
|
||||
"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": "e2e7060f-3895-4c6c-964d-5e9e24fc932d@f9941",
|
||||
"displayName": "man",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 1067,
|
||||
"height": 600,
|
||||
"rawWidth": 1067,
|
||||
"rawHeight": 600,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-533.5,
|
||||
-300,
|
||||
0,
|
||||
533.5,
|
||||
-300,
|
||||
0,
|
||||
-533.5,
|
||||
300,
|
||||
0,
|
||||
533.5,
|
||||
300,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
600,
|
||||
1067,
|
||||
600,
|
||||
0,
|
||||
0,
|
||||
1067,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-533.5,
|
||||
-300,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
533.5,
|
||||
300,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "e2e7060f-3895-4c6c-964d-5e9e24fc932d@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "e2e7060f-3895-4c6c-964d-5e9e24fc932d@f9941"
|
||||
}
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 16
|
||||
"__id__": 20
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
},
|
||||
"autoReleaseAssets": false,
|
||||
"_globals": {
|
||||
"__id__": 17
|
||||
"__id__": 21
|
||||
},
|
||||
"_id": "f713b5ea-a70f-486c-8260-0338f089a5b8"
|
||||
},
|
||||
|
|
@ -77,13 +77,13 @@
|
|||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 13
|
||||
"__id__": 17
|
||||
},
|
||||
{
|
||||
"__id__": 14
|
||||
"__id__": 18
|
||||
},
|
||||
{
|
||||
"__id__": 15
|
||||
"__id__": 19
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
|
|
@ -218,6 +218,9 @@
|
|||
"_children": [
|
||||
{
|
||||
"__id__": 6
|
||||
},
|
||||
{
|
||||
"__id__": 13
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
|
|
@ -265,7 +268,7 @@
|
|||
"__id__": 7
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 11
|
||||
|
|
@ -487,6 +490,133 @@
|
|||
"_atlas": null,
|
||||
"_id": "09PWASedFO8q9MmAgOXEGD"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "SpriteSplash",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 14
|
||||
},
|
||||
{
|
||||
"__id__": 15
|
||||
},
|
||||
{
|
||||
"__id__": 16
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 600,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "f3uurI1edKpb/AsUQZyW7c"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 13
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": "a2z+iX/j1MVKZ3LuPz8/iM"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 13
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 0,
|
||||
"_fillType": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_id": "0apjnJJkpLlKFaw0omFEuX"
|
||||
},
|
||||
{
|
||||
"__type__": "9258d3QVRBC/L8BCziIBXzT",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 13
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"DefaultImgPath": "sprite/interface2/event/chn_event_2020/200922_dnf_marble/00_main.img",
|
||||
"_GImgIndex": 0,
|
||||
"PlayState": 1,
|
||||
"_id": "a27U1G+TROF7ArDt28B3wZ"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
|
|
@ -566,29 +696,29 @@
|
|||
{
|
||||
"__type__": "cc.SceneGlobals",
|
||||
"ambient": {
|
||||
"__id__": 18
|
||||
},
|
||||
"shadows": {
|
||||
"__id__": 19
|
||||
},
|
||||
"_skybox": {
|
||||
"__id__": 20
|
||||
},
|
||||
"fog": {
|
||||
"__id__": 21
|
||||
},
|
||||
"octree": {
|
||||
"__id__": 22
|
||||
},
|
||||
"skin": {
|
||||
"shadows": {
|
||||
"__id__": 23
|
||||
},
|
||||
"lightProbeInfo": {
|
||||
"_skybox": {
|
||||
"__id__": 24
|
||||
},
|
||||
"postSettings": {
|
||||
"fog": {
|
||||
"__id__": 25
|
||||
},
|
||||
"octree": {
|
||||
"__id__": 26
|
||||
},
|
||||
"skin": {
|
||||
"__id__": 27
|
||||
},
|
||||
"lightProbeInfo": {
|
||||
"__id__": 28
|
||||
},
|
||||
"postSettings": {
|
||||
"__id__": 29
|
||||
},
|
||||
"bakedWithStationaryMainLight": false,
|
||||
"bakedWithHighpLightmap": false
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue