diff --git a/assets/GlobalScript/Animation/BaseSprite.ts b/assets/GlobalScript/Animation/BaseSprite.ts index 04bbff1..7c70ccb 100644 --- a/assets/GlobalScript/Animation/BaseSprite.ts +++ b/assets/GlobalScript/Animation/BaseSprite.ts @@ -4,6 +4,7 @@ import { MyAnimation } from './MyAnimation'; const { ccclass, property, requireComponent, executeInEditMode } = _decorator; @ccclass('BaseSprite') +@executeInEditMode @requireComponent(Sprite)//依赖组件 精灵 export default class BaseSprite extends MyAnimation { @@ -15,16 +16,21 @@ export default class BaseSprite extends MyAnimation { ImgPath: string[] = ["", ""]; @property({ type: CCInteger, displayName: 'img编号', tooltip: "img编号" }) - _GImgIndex = 0; - ImgIndex: number[] = [0, 0]; + GImgIndex = 0; + ImgIndex: number[] = [0, 1]; FrameDelay: Array = [0, 9999999999]; @property({ type: [CCInteger], displayName: '是否显示', tooltip: "1为显示 0为不显示" }) PlayState = 0; - on_GImgIndexChanged() { - this.ImgIndex[1] = this._GImgIndex; + onGImgIndexChanged() { + this.ImgIndex[0] = this.GImgIndex; + } + + start() { + this.onGImgIndexChanged(); + super.start(); } } diff --git a/assets/scene/main.scene b/assets/scene/main.scene index fbf8ea8..830bc94 100644 --- a/assets/scene/main.scene +++ b/assets/scene/main.scene @@ -23,7 +23,7 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 20 + "__id__": 17 }, "_lpos": { "__type__": "cc.Vec3", @@ -54,7 +54,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 21 + "__id__": 18 }, "_id": "f713b5ea-a70f-486c-8260-0338f089a5b8" }, @@ -77,13 +77,13 @@ "_active": true, "_components": [ { - "__id__": 17 + "__id__": 14 }, { - "__id__": 18 + "__id__": 15 }, { - "__id__": 19 + "__id__": 16 } ], "_prefab": null, @@ -218,9 +218,6 @@ "_children": [ { "__id__": 6 - }, - { - "__id__": 13 } ], "_active": true, @@ -257,7 +254,7 @@ }, { "__type__": "cc.Node", - "_name": "man", + "_name": "SpriteSplash", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -268,20 +265,23 @@ "__id__": 7 } ], - "_active": false, + "_active": true, "_components": [ { "__id__": 11 }, { "__id__": 12 + }, + { + "__id__": 13 } ], "_prefab": null, "_lpos": { "__type__": "cc.Vec3", - "x": 533.5, - "y": 300.00000000000006, + "x": 0, + "y": 600, "z": 0 }, "_lrot": { @@ -298,14 +298,14 @@ "z": 1 }, "_mobility": 0, - "_layer": 33554432, + "_layer": 1073741824, "_euler": { "__type__": "cc.Vec3", "x": 0, "y": 0, "z": 0 }, - "_id": "15jnF2IOpHl7U589UpZ7wK" + "_id": "f3uurI1edKpb/AsUQZyW7c" }, { "__type__": "cc.Node", @@ -331,8 +331,8 @@ "_prefab": null, "_lpos": { "__type__": "cc.Vec3", - "x": -397.219, - "y": -95, + "x": 136.281, + "y": -394.99999999999994, "z": 0 }, "_lrot": { @@ -441,15 +441,15 @@ "__prefab": null, "_contentSize": { "__type__": "cc.Size", - "width": 1067, - "height": 600 + "width": 2, + "height": 2 }, "_anchorPoint": { "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 + "x": 0, + "y": 1 }, - "_id": "bfP8LMTRJEs6IZCp14QQ6g" + "_id": "a2z+iX/j1MVKZ3LuPz8/iM" }, { "__type__": "cc.Sprite", @@ -471,125 +471,13 @@ "b": 255, "a": 255 }, - "_spriteFrame": { - "__uuid__": "e2e7060f-3895-4c6c-964d-5e9e24fc932d@f9941", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 1, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_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, + "_sizeMode": 2, "_fillCenter": { "__type__": "cc.Vec2", "x": 0, @@ -597,7 +485,7 @@ }, "_fillStart": 0, "_fillRange": 0, - "_isTrimmedMode": true, + "_isTrimmedMode": false, "_useGrayscale": false, "_atlas": null, "_id": "0apjnJJkpLlKFaw0omFEuX" @@ -608,12 +496,12 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 13 + "__id__": 6 }, "_enabled": true, "__prefab": null, "DefaultImgPath": "sprite/interface2/event/chn_event_2020/200922_dnf_marble/00_main.img", - "_GImgIndex": 0, + "GImgIndex": 0, "PlayState": 1, "_id": "a27U1G+TROF7ArDt28B3wZ" }, @@ -696,28 +584,28 @@ { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 22 + "__id__": 19 }, "shadows": { - "__id__": 23 + "__id__": 20 }, "_skybox": { - "__id__": 24 + "__id__": 21 }, "fog": { - "__id__": 25 + "__id__": 22 }, "octree": { - "__id__": 26 + "__id__": 23 }, "skin": { - "__id__": 27 + "__id__": 24 }, "lightProbeInfo": { - "__id__": 28 + "__id__": 25 }, "postSettings": { - "__id__": 29 + "__id__": 26 }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false