[add] init
9
.editorconfig
Normal file
@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
69
.gitignore
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# Fireball Projects
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
library/
|
||||
temp/
|
||||
local/
|
||||
build/
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# Logs and databases
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
*.log
|
||||
*.sql
|
||||
*.sqlite
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# files for debugger
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
*.sln
|
||||
*.csproj
|
||||
*.pidb
|
||||
*.unityproj
|
||||
*.suo
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# OS generated files
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
.DS_Store
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# exvim files
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
*UnityVS.meta
|
||||
*.err
|
||||
*.err.meta
|
||||
*.exvim
|
||||
*.exvim.meta
|
||||
*.vimentry
|
||||
*.vimentry.meta
|
||||
*.vimproject
|
||||
*.vimproject.meta
|
||||
.vimfiles.*/
|
||||
.exvim.*/
|
||||
quick_gen_project_*_autogen.bat
|
||||
quick_gen_project_*_autogen.bat.meta
|
||||
quick_gen_project_*_autogen.sh
|
||||
quick_gen_project_*_autogen.sh.meta
|
||||
.exvim.app
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# webstorm files
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
.idea/
|
||||
|
||||
#//////////////////////////
|
||||
# VS Code
|
||||
#//////////////////////////
|
||||
|
||||
.vscode/
|
||||
|
||||
packages/pngquant/
|
7
.prettierrc
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"trailingComma": "none",
|
||||
"singleQuote": true,
|
||||
"semi": true,
|
||||
"tabWidth": 2,
|
||||
"printWidth": 120
|
||||
}
|
119
README.md
Normal file
@ -0,0 +1,119 @@
|
||||
# cocos-awesome
|
||||
|
||||
![](https://img.shields.io/badge/cocos%20Creator-%5E2.3.x-brightgreen)
|
||||
![](https://img.shields.io/github/last-commit/ifengzp/cocos-awesome)
|
||||
![](https://img.shields.io/github/commit-activity/m/ifengzp/cocos-awesome)
|
||||
|
||||
cocos是一款挺棒的游戏引擎,我在这个仓库实现一些游戏当中比较使用的功能模块,对应的一个功能一个场景,用的引擎版本是`v2.3.0`,理论上兼容到`v2.3.x`以上,实现的思路在`doc`目录中。
|
||||
|
||||
# 目前已实现效果
|
||||
|
||||
[水波扩散(shader)](./doc/Water_spread/水波扩散效果.md)
|
||||
[镜面光泽(shader)](./doc/Specular_gloss/镜面光泽.md)
|
||||
[圆形头像(shader)](./doc/Circle_avatar/shader圆形头像.md)
|
||||
[溶解效果(shader)](./doc/Dissolve_color/溶解效果.md)
|
||||
[刮刮卡实现](./doc/Scratch_ticket/Scratch_ticket.md)
|
||||
[金币落袋效果](./doc/Coin_fly_to_wallet/金币落袋效果.md)
|
||||
[放大镜效果](./doc/Magnifying_mirror/局部放大效果.md)
|
||||
[追光效果(shader)](./doc/Follow_spot/追光效果.md)
|
||||
[打字机效果](./doc/Typer/打字机效果.md)
|
||||
[子弹跟踪效果](./doc/Bullet_Tracking/子弹跟踪效果.md)
|
||||
[移动残影效果](./doc/Moving_ghost/Moving_ghost.md)
|
||||
[背景无限滚动](./doc/Infinite_bg_scroll/背景无限滚动.md)
|
||||
[遥控杆](./doc/Joystick/遥控杆.md)
|
||||
[马赛克/像素风(shader)](./doc/Mosaic/马赛克像素风.md)
|
||||
[渐变过渡的相册(shader)](./doc/Photo_gallery/渐变过渡的相册.md)
|
||||
2D换装
|
||||
震屏效果+动画恢复第一帧
|
||||
|
||||
# 预览二维码
|
||||
|
||||
![预览二维码](./doc/demo.png)
|
||||
|
||||
## 融球效果(shader)
|
||||
元球也叫融球,它能够让两个球体产生“黏糊糊”的效果,是流体,融合等效果的实现基础,异名这次实现的demo是一个固定的大圆,然后手指控制一个游离态的小圆
|
||||
|
||||
![demo](./doc/Metaball/resources/demo.gif)
|
||||
|
||||
## 水波扩散(shader)
|
||||
水波扩散是一个比较好看的交互效果,特别是在某些以水为故事发生场景的游戏中,扩散的水波会让场景更加栩栩如生。
|
||||
|
||||
![demo](./doc/Water_spread/resource/demo.gif)
|
||||
|
||||
## 镜面光泽(shader)
|
||||
镜面上扫过一道光泽是UI里面很常用的一种特效,通常用来强调某个物体或者凸显物体的“稀有”价值,比如卡片中扫过一道光芒等
|
||||
|
||||
![demo](./doc/Specular_gloss/resources/demo.gif)
|
||||
|
||||
## 追光效果(shader)
|
||||
追光效果是在舞台全场黑暗的情况下用光柱突出角色或其他特殊物体,通过人为操控光源跟随人物移动,主要用来突出角色主体以及主体和环境的关系。在游戏中可以用来突出氛围以及聚焦玩家视线焦点,不仅可以用来营造沉浸式氛围,也可以用在解谜或者找物品等类别的游戏中。
|
||||
|
||||
![demo](./doc/Follow_spot/resources/demo.gif)
|
||||
|
||||
## 马赛克/像素风(shader)
|
||||
马赛克是一种常用的图像处理手段,主要功能就是使图像模糊,因为这种模糊看上去有一个个的小格子组,便形象的称这种画面为马赛克。当马赛克越来越小的时候,画面呈现出来的效果也叫像素风。
|
||||
|
||||
![demo](./doc/Mosaic/resources/demo.gif)
|
||||
|
||||
## 溶解效果(shader)
|
||||
物体的淡入淡出是游戏当中很常见的一种状态切换效果,但是有时候我们希望`fade`切换的时候,物体能够能更有色彩层次感或者其他一些特殊的中间状态,这个时候就得自己去写着色器,这种区别于单纯的淡入和淡出的效果可以形象地叫做溶解。
|
||||
|
||||
![demo](./doc/Dissolve_color/resources/demo.gif)
|
||||
|
||||
## 圆形头像(shader)
|
||||
圆形头像在creator中没有提供,但是这个又是个比较高频的使用功能。
|
||||
|
||||
![demo](./doc/Circle_avatar/resources/demo.png)
|
||||
|
||||
|
||||
## 刮刮卡实现
|
||||
奖券,优惠券什么的就需要用到刮刮卡的效果了,大家生活里都使用过。
|
||||
|
||||
![Scratch_ticket](./doc/Scratch_ticket/resource/Scratch_ticket.gif)
|
||||
|
||||
## 金币落袋效果
|
||||
金币从初始点散开然后逐个飞落到指定的位置,这是游戏里面很常用的一个动画,效果如下
|
||||
|
||||
![金币落袋](./doc/Coin_fly_to_wallet/resourse/fly_gold.gif)
|
||||
|
||||
## 放大镜效果
|
||||
对画面的某个位置进行放大和缩小,是某些类型游戏里面必不可少的功能,比如常见的地图缩放,局部细节放大等等。它核心是对相机应用,异名基于此实现一个放大镜的demo
|
||||
|
||||
![demo](./doc/Magnifying_mirror/resources/demo.gif)
|
||||
|
||||
## 打字机效果
|
||||
打字机效果也就是让文字逐个在屏幕中显示,直到把整段话说完,常常被应用到人物对话,角色旁白甚至引导教程等高频场景中。
|
||||
|
||||
![demo](./doc/Typer/resource/demo.gif)
|
||||
|
||||
## 子弹跟踪效果
|
||||
打击的目标一直在移动,但是子弹却像长了眼睛一样在后面尾随,直到精准击中目标。这种“长了眼睛的子弹”,是打击类游戏中比较经典的武器之一。
|
||||
|
||||
![demo](./doc/Bullet_Tracking/resources/demo.gif)
|
||||
|
||||
## 移动残影效果
|
||||
游戏中的人物移动带起残影,用来表达速度是很有视觉表现力的。异名的实现思路是从“白玉无冰”那里照搬过来的,在具体的实现上面添加了一些异名自己的理解。
|
||||
|
||||
![demo](./doc/Moving_ghost/resource/demo.gif)
|
||||
|
||||
## 颜色滤镜
|
||||
我们手机上有很多照片处理软件,图片滤镜是里面不可或缺的一部分,我们可以先尝试一些很简单的滤镜的算法,管中窥豹地去认识一下色彩的处理
|
||||
|
||||
![demo](./doc/Filter/resources/demo.png)
|
||||
|
||||
## 背景无限滚动
|
||||
这是游戏里面很常用的一个功能模块,它就像你的生活,有着走不完的路程。它的实现也很简单,要么做一个很长的背景图,然后移动相机;要么就是实现一个跑马灯,像那些轮播图什么的,大家应该都有写过。
|
||||
|
||||
![demo](./doc/Infinite_bg_scroll/resourse/Infinite_bg_scroll.gif)
|
||||
|
||||
## 遥控杆
|
||||
这是游戏里面很常用的一个功能模块,通过操控遥控杆控制物体的移动
|
||||
|
||||
![Joystick](./doc/Joystick/resourse/Joystick.gif)
|
||||
|
||||
## 渐变过渡的相册(shader)
|
||||
相册是一个大家比较熟悉的场景,一般我们是实现的都是那种跑马灯式的轮播相册,这里异名给大家提供一个利用shader实现图片渐变过渡的相册思路
|
||||
|
||||
![渐变过渡的相册](./doc/Photo_gallery/resources/demo.gif)
|
||||
|
||||
|
6
assets/Scene.meta
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "29f52784-2fca-467b-92e7-8fd9ef8c57b7",
|
||||
"isGroup": false,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Bullet_Tracking.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "be004c5c-ce04-43be-beb2-92f5ce3b78ec",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
929
assets/Scene/Bullet_Tracking/Bullet_Tracking.fire
Normal file
@ -0,0 +1,929 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.SceneAsset",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"scene": {
|
||||
"__id__": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Scene",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_is3DNode": true,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"autoReleaseAssets": false,
|
||||
"_id": "172a5db1-870b-4530-aaa4-608f6ce3d94c"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Canvas",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 3
|
||||
},
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 8
|
||||
},
|
||||
{
|
||||
"__id__": 12
|
||||
},
|
||||
{
|
||||
"__id__": 14
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 19
|
||||
},
|
||||
{
|
||||
"__id__": 20
|
||||
},
|
||||
{
|
||||
"__id__": 21
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1334,
|
||||
"height": 750
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
667,
|
||||
375,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "a5esZu+45LA5mBpvttspPD"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Main Camera",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 4
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1334,
|
||||
"height": 750
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
452.93128617926146,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Camera",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 3
|
||||
},
|
||||
"_enabled": true,
|
||||
"_cullingMask": 4294967295,
|
||||
"_clearFlags": 7,
|
||||
"_backgroundColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_depth": -1,
|
||||
"_zoomRatio": 1,
|
||||
"_targetTexture": null,
|
||||
"_fov": 60,
|
||||
"_orthoSize": 10,
|
||||
"_nearClip": 1,
|
||||
"_farClip": 4096,
|
||||
"_ortho": true,
|
||||
"_rect": {
|
||||
"__type__": "cc.Rect",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 1,
|
||||
"height": 1
|
||||
},
|
||||
"_renderStages": 1,
|
||||
"_alignWithScreen": true,
|
||||
"_id": "81GN3uXINKVLeW4+iKSlim"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "bg",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 6
|
||||
},
|
||||
{
|
||||
"__id__": 7
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 27,
|
||||
"g": 38,
|
||||
"b": 46,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1334,
|
||||
"height": 750
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "d0dRUqkgFCKL8trxbA1lqx"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "ee7142bc-4247-47df-8aa7-fc099863a0b1"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "e5slGX6iVPuKI/p4Z8CM3w"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 45,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 2,
|
||||
"_originalHeight": 2,
|
||||
"_id": "a6VcDCH9xO67zPO3OKOVph"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "bullet",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 9
|
||||
}
|
||||
],
|
||||
"_active": false,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 11
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 47,
|
||||
"height": 106
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 1,
|
||||
"y": 1
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
598.804,
|
||||
-270.25,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0.5,
|
||||
0.5,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "36ltwT2ZpJMrUGGa16YPQl"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "boom",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_children": [],
|
||||
"_active": false,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 10
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 57,
|
||||
"height": 50
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "eezmlWb+1MAZzfp9GfFZaL"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 9
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "30c08d99-60a4-404d-8386-214b5aceee0f"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 1,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "b9b/ZeezBB5JJmYu9kGnFe"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "1f6252f6-2091-4bb3-a45e-e207326408b8"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 1,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "88IuuHnEZP+7rbkDKSKhxg"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "target",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 13
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 61,
|
||||
"height": 55
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "14JT6wGJJGiq4ShaaT6dx3"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 12
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "33189cfd-0653-4042-af81-930140632e0a"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 1,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "91LVBUpK5N9It8f13CTyUR"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "launch_btn",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 15
|
||||
},
|
||||
{
|
||||
"__id__": 16
|
||||
},
|
||||
{
|
||||
"__id__": 17
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 124,
|
||||
"height": 106
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
587,
|
||||
-295,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0.5,
|
||||
0.5,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "efLF3bXflDqI6HPTVwFrPP"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 14
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "de94b84a-7534-4afe-8800-56beaa02bc52"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 1,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "cbKJaUEI9CS4ktqrC28VuE"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 14
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 36,
|
||||
"_left": 0,
|
||||
"_right": 49,
|
||||
"_top": 0,
|
||||
"_bottom": 53.5,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": "62tYmolMBAUZ3ucJSVOupu"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Button",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 14
|
||||
},
|
||||
"_enabled": true,
|
||||
"_normalMaterial": {
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
},
|
||||
"_grayMaterial": null,
|
||||
"duration": 0.1,
|
||||
"zoomScale": 1.2,
|
||||
"clickEvents": [
|
||||
{
|
||||
"__id__": 18
|
||||
}
|
||||
],
|
||||
"_N$interactable": true,
|
||||
"_N$enableAutoGrayEffect": false,
|
||||
"_N$transition": 3,
|
||||
"transition": 3,
|
||||
"_N$normalColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_N$pressedColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 211,
|
||||
"g": 211,
|
||||
"b": 211,
|
||||
"a": 255
|
||||
},
|
||||
"pressedColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 211,
|
||||
"g": 211,
|
||||
"b": 211,
|
||||
"a": 255
|
||||
},
|
||||
"_N$hoverColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"hoverColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_N$disabledColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 124,
|
||||
"g": 124,
|
||||
"b": 124,
|
||||
"a": 255
|
||||
},
|
||||
"_N$normalSprite": null,
|
||||
"_N$pressedSprite": null,
|
||||
"pressedSprite": null,
|
||||
"_N$hoverSprite": null,
|
||||
"hoverSprite": null,
|
||||
"_N$disabledSprite": null,
|
||||
"_N$target": null,
|
||||
"_id": "bctQ0+s3hBObKNMRXBndp1"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.ClickEvent",
|
||||
"target": {
|
||||
"__id__": 2
|
||||
},
|
||||
"component": "",
|
||||
"_componentId": "82433YSgYFI4Kmfyazc1Wwg",
|
||||
"handler": "fire",
|
||||
"customEventData": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Canvas",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_designResolution": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1334,
|
||||
"height": 750
|
||||
},
|
||||
"_fitWidth": false,
|
||||
"_fitHeight": true,
|
||||
"_id": "59Cd0ovbdF4byw5sbjJDx7"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 45,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": "29zXboiXFBKoIV4PQ2liTe"
|
||||
},
|
||||
{
|
||||
"__type__": "82433YSgYFI4Kmfyazc1Wwg",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"launch_btn": {
|
||||
"__id__": 14
|
||||
},
|
||||
"bullet": {
|
||||
"__id__": 8
|
||||
},
|
||||
"target": {
|
||||
"__id__": 12
|
||||
},
|
||||
"_id": "f5CdQPqKBBqbA0uByvZuYz"
|
||||
}
|
||||
]
|
7
assets/Scene/Bullet_Tracking/Bullet_Tracking.fire.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.6",
|
||||
"uuid": "172a5db1-870b-4530-aaa4-608f6ce3d94c",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
57
assets/Scene/Bullet_Tracking/Bullet_Tracking.ts
Normal file
@ -0,0 +1,57 @@
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Bullet_Tracking extends cc.Component {
|
||||
@property(cc.Node)
|
||||
launch_btn: cc.Node = null;
|
||||
|
||||
@property(cc.Node)
|
||||
bullet: cc.Node = null;
|
||||
|
||||
@property(cc.Node)
|
||||
target: cc.Node = null;
|
||||
|
||||
onLoad() {
|
||||
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.touchMoveEvent, this);
|
||||
}
|
||||
|
||||
touchMoveEvent(evt: cc.Event.EventTouch) {
|
||||
this.target.x += evt.getDeltaX();
|
||||
this.target.y += evt.getDeltaY();
|
||||
}
|
||||
|
||||
fireFlag: boolean = false;
|
||||
fire() {
|
||||
this.bullet.getComponent(cc.Sprite).enabled = true;
|
||||
this.bullet.getChildByName('boom').active = false;
|
||||
this.bullet.setPosition(this.launch_btn.position);
|
||||
this.bullet.active = true;
|
||||
this.fireFlag = true;
|
||||
}
|
||||
|
||||
hitTheTarget() {
|
||||
this.fireFlag = false;
|
||||
this.bullet.getComponent(cc.Sprite).enabled = false;
|
||||
this.bullet.getChildByName('boom').active = true;
|
||||
this.scheduleOnce(() => {
|
||||
this.bullet.getChildByName('boom').active = false;
|
||||
}, 0.2);
|
||||
}
|
||||
|
||||
bulletSpeed = 200;
|
||||
update(dt) {
|
||||
if (!this.fireFlag) return;
|
||||
|
||||
let targetPos: cc.Vec2 = this.target.getPosition();
|
||||
let bulletPos: cc.Vec2 = this.bullet.getPosition();
|
||||
let normalizeVec: cc.Vec2 = targetPos.subtract(bulletPos).normalize();
|
||||
|
||||
this.bullet.x += normalizeVec.x * this.bulletSpeed * dt;
|
||||
this.bullet.y += normalizeVec.y * this.bulletSpeed * dt;
|
||||
// 角度变化以y轴正方向为起点,逆时针角度递增
|
||||
this.bullet.angle = cc.v2(0, 1).signAngle(normalizeVec) * 180 / Math.PI;
|
||||
|
||||
let rect = this.target.getBoundingBox();
|
||||
if (rect.contains(bulletPos)) this.hitTheTarget();
|
||||
}
|
||||
}
|
9
assets/Scene/Bullet_Tracking/Bullet_Tracking.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.5",
|
||||
"uuid": "82433612-8181-48e0-a99f-c9acdcd56c20",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Bullet_Tracking/Texture.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "444a6543-4916-4e50-ac0c-a1e16faddec2",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
BIN
assets/Scene/Bullet_Tracking/Texture/boom.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
36
assets/Scene/Bullet_Tracking/Texture/boom.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "3f7fcddf-3735-4a91-a91f-34a1506d8139",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 57,
|
||||
"height": 50,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"boom": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "30c08d99-60a4-404d-8386-214b5aceee0f",
|
||||
"rawTextureUuid": "3f7fcddf-3735-4a91-a91f-34a1506d8139",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 57,
|
||||
"height": 50,
|
||||
"rawWidth": 57,
|
||||
"rawHeight": 50,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Bullet_Tracking/Texture/bullet.png
Normal file
After Width: | Height: | Size: 12 KiB |
36
assets/Scene/Bullet_Tracking/Texture/bullet.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "ca06372b-2258-4713-865a-58d43a0e8f32",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 48,
|
||||
"height": 106,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"bullet": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "1f6252f6-2091-4bb3-a45e-e207326408b8",
|
||||
"rawTextureUuid": "ca06372b-2258-4713-865a-58d43a0e8f32",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0.5,
|
||||
"offsetY": 0,
|
||||
"trimX": 1,
|
||||
"trimY": 0,
|
||||
"width": 47,
|
||||
"height": 106,
|
||||
"rawWidth": 48,
|
||||
"rawHeight": 106,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Bullet_Tracking/Texture/bullet_btn.png
Normal file
After Width: | Height: | Size: 24 KiB |
36
assets/Scene/Bullet_Tracking/Texture/bullet_btn.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "3f0cfa4a-91ee-468f-8be2-7e2b127a4d9b",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 124,
|
||||
"height": 106,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"bullet_btn": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "de94b84a-7534-4afe-8800-56beaa02bc52",
|
||||
"rawTextureUuid": "3f0cfa4a-91ee-468f-8be2-7e2b127a4d9b",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 124,
|
||||
"height": 106,
|
||||
"rawWidth": 124,
|
||||
"rawHeight": 106,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Bullet_Tracking/Texture/single_color.png
Normal file
After Width: | Height: | Size: 82 B |
36
assets/Scene/Bullet_Tracking/Texture/single_color.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "119290a9-b860-401f-baf6-c45092eeff9d",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"single_color": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "ee7142bc-4247-47df-8aa7-fc099863a0b1",
|
||||
"rawTextureUuid": "119290a9-b860-401f-baf6-c45092eeff9d",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"rawWidth": 2,
|
||||
"rawHeight": 2,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Bullet_Tracking/Texture/target.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
36
assets/Scene/Bullet_Tracking/Texture/target.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "e347177e-a16b-4081-a726-668a90881195",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 61,
|
||||
"height": 55,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"target": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "33189cfd-0653-4042-af81-930140632e0a",
|
||||
"rawTextureUuid": "e347177e-a16b-4081-a726-668a90881195",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 61,
|
||||
"height": 55,
|
||||
"rawWidth": 61,
|
||||
"rawHeight": 55,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
7
assets/Scene/Change_clothes.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "a6dac459-c33a-4f03-b647-56b0c59d85ca",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
2367
assets/Scene/Change_clothes/Change_clothes.fire
Normal file
7
assets/Scene/Change_clothes/Change_clothes.fire.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.6",
|
||||
"uuid": "c4df9fcd-77b0-4ec2-aed0-a6012e6bbe5d",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
35
assets/Scene/Change_clothes/Change_clothes.ts
Normal file
@ -0,0 +1,35 @@
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Change_clothes extends cc.Component {
|
||||
@property(cc.SpriteAtlas)
|
||||
npcAtlas: cc.SpriteAtlas = null;
|
||||
|
||||
@property(cc.Sprite)
|
||||
hair: cc.Sprite = null;
|
||||
@property(cc.Sprite)
|
||||
clothes: cc.Sprite = null;
|
||||
@property(cc.Sprite)
|
||||
sleeve: cc.Sprite = null;
|
||||
@property(cc.Sprite)
|
||||
shoe: cc.Sprite = null;
|
||||
|
||||
changeClothes(evn, type: string) {
|
||||
let hairType = this.hair.spriteFrame.name == 'hair_1';
|
||||
let clothesType = this.clothes.spriteFrame.name == 'clothes_1';
|
||||
let shoeType = this.shoe.spriteFrame.name == 'shoe_1';
|
||||
|
||||
switch (type) {
|
||||
case 'hair':
|
||||
this.hair.spriteFrame = this.npcAtlas.getSpriteFrame(hairType ? 'hair_2' : 'hair_1');
|
||||
break;
|
||||
case 'clothes':
|
||||
this.clothes.spriteFrame = this.npcAtlas.getSpriteFrame(clothesType ? 'clothes_2' : 'clothes_1');
|
||||
this.sleeve.spriteFrame = this.npcAtlas.getSpriteFrame(clothesType ? 'sleeve_2' : 'sleeve_1');
|
||||
break;
|
||||
case 'shoe':
|
||||
this.shoe.spriteFrame = this.npcAtlas.getSpriteFrame(shoeType ? 'shoe_2' : 'shoe_1');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
9
assets/Scene/Change_clothes/Change_clothes.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.5",
|
||||
"uuid": "2bc1fe49-a1db-4811-9161-c1b52e775574",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Change_clothes/Texture.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "c79f08da-06e4-4b34-9a30-400cf5d243a4",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
191
assets/Scene/Change_clothes/Texture/npc.plist
Normal file
@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>frames</key>
|
||||
<dict>
|
||||
<key>body.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{92,312}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{92,312}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{0,0},{92,312}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>clothes_1.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{90,227}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{90,227}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{92,0},{90,227}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>clothes_2.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{90,227}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{90,227}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{182,0},{90,227}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>hair_1.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{76,84}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{76,84}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{272,0},{76,84}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>hair_2.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{76,84}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{76,84}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{348,0},{76,84}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>hair_3.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{63,63}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{63,63}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{0,312},{63,63}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>hand.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{78,74}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{78,74}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{63,312},{78,74}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>shoe_1.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{47,37}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{47,37}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{141,312},{47,37}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>shoe_2.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{47,37}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{47,37}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{188,312},{47,37}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>sleeve_1.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{78,74}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{78,74}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{235,312},{78,74}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>sleeve_2.png</key>
|
||||
<dict>
|
||||
<key>aliases</key>
|
||||
<array/>
|
||||
<key>spriteOffset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>spriteSize</key>
|
||||
<string>{78,74}</string>
|
||||
<key>spriteSourceSize</key>
|
||||
<string>{78,74}</string>
|
||||
<key>textureRect</key>
|
||||
<string>{{313,312},{78,74}}</string>
|
||||
<key>textureRotated</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>metadata</key>
|
||||
<dict>
|
||||
<key>format</key>
|
||||
<integer>3</integer>
|
||||
<key>pixelFormat</key>
|
||||
<string>RGBA8888</string>
|
||||
<key>premultiplyAlpha</key>
|
||||
<false/>
|
||||
<key>realTextureFileName</key>
|
||||
<string>npc.png</string>
|
||||
<key>size</key>
|
||||
<string>{424,386}</string>
|
||||
<key>smartupdate</key>
|
||||
<string>$TexturePacker:SmartUpdate:cef21886e2271f7e0451b5b9668dcb98:be2e04fd83b88e89a172d9ae823edcd9:0b760b9359d5dddae5dab0980cb73d8a$</string>
|
||||
<key>textureFileName</key>
|
||||
<string>npc.png</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
254
assets/Scene/Change_clothes/Texture/npc.plist.meta
Normal file
@ -0,0 +1,254 @@
|
||||
{
|
||||
"ver": "1.2.4",
|
||||
"uuid": "9c086bbc-22f5-4e67-a406-275f72a6ec8d",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"size": {
|
||||
"width": 424,
|
||||
"height": 386
|
||||
},
|
||||
"type": "Texture Packer",
|
||||
"subMetas": {
|
||||
"body.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "cc02c745-b6f9-4d19-b048-c06154385769",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 92,
|
||||
"height": 312,
|
||||
"rawWidth": 92,
|
||||
"rawHeight": 312,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"clothes_1.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "3c1d2537-c7d4-4262-897d-935091f87db7",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 92,
|
||||
"trimY": 0,
|
||||
"width": 90,
|
||||
"height": 227,
|
||||
"rawWidth": 90,
|
||||
"rawHeight": 227,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"clothes_2.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "a0c3925b-ee55-4cc5-8ab5-acd4bc7ab70e",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 182,
|
||||
"trimY": 0,
|
||||
"width": 90,
|
||||
"height": 227,
|
||||
"rawWidth": 90,
|
||||
"rawHeight": 227,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"hair_1.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "e9f3c10f-4801-41a4-8663-3fd896d18eef",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 272,
|
||||
"trimY": 0,
|
||||
"width": 76,
|
||||
"height": 84,
|
||||
"rawWidth": 76,
|
||||
"rawHeight": 84,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"hair_2.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "2df09bb5-82de-49ae-9fae-57267ac94230",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 348,
|
||||
"trimY": 0,
|
||||
"width": 76,
|
||||
"height": 84,
|
||||
"rawWidth": 76,
|
||||
"rawHeight": 84,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"hair_3.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "8f7541e4-f656-43c5-b078-a476afbfa091",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 312,
|
||||
"width": 63,
|
||||
"height": 63,
|
||||
"rawWidth": 63,
|
||||
"rawHeight": 63,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"hand.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "361aeeb3-a1af-48aa-874a-53d09f17eb71",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 63,
|
||||
"trimY": 312,
|
||||
"width": 78,
|
||||
"height": 74,
|
||||
"rawWidth": 78,
|
||||
"rawHeight": 74,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"shoe_1.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "fe9f4bf5-0e7c-41e0-8b83-be6b449cffb4",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 141,
|
||||
"trimY": 312,
|
||||
"width": 47,
|
||||
"height": 37,
|
||||
"rawWidth": 47,
|
||||
"rawHeight": 37,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"shoe_2.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "f0994c5d-414c-462f-8d53-897a5a4c1603",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 188,
|
||||
"trimY": 312,
|
||||
"width": 47,
|
||||
"height": 37,
|
||||
"rawWidth": 47,
|
||||
"rawHeight": 37,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"sleeve_1.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "160dce43-46b9-46f2-8812-704e6cfcba44",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 235,
|
||||
"trimY": 312,
|
||||
"width": 78,
|
||||
"height": 74,
|
||||
"rawWidth": 78,
|
||||
"rawHeight": 74,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"sleeve_2.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "d76cbca5-a184-4da9-baea-06176ac21645",
|
||||
"rawTextureUuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 313,
|
||||
"trimY": 312,
|
||||
"width": 78,
|
||||
"height": 74,
|
||||
"rawWidth": 78,
|
||||
"rawHeight": 74,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Change_clothes/Texture/npc.png
Normal file
After Width: | Height: | Size: 32 KiB |
14
assets/Scene/Change_clothes/Texture/npc.png.meta
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "21ea33ab-5d19-4eab-a6c6-33292fa1b747",
|
||||
"type": "raw",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 424,
|
||||
"height": 386,
|
||||
"platformSettings": {},
|
||||
"subMetas": {}
|
||||
}
|
BIN
assets/Scene/Change_clothes/Texture/single_color.png
Normal file
After Width: | Height: | Size: 82 B |
36
assets/Scene/Change_clothes/Texture/single_color.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "1f9eac43-49fa-4640-9525-751efe1a1148",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"single_color": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "18f35f36-3709-4100-9ac0-404717b8bf02",
|
||||
"rawTextureUuid": "1f9eac43-49fa-4640-9525-751efe1a1148",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"rawWidth": 2,
|
||||
"rawHeight": 2,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
7
assets/Scene/Circle_avatar.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "369ae4de-2a57-4e1e-a923-74b76ace7acc",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
805
assets/Scene/Circle_avatar/Circle_avatar.fire
Normal file
@ -0,0 +1,805 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.SceneAsset",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"scene": {
|
||||
"__id__": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Scene",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_is3DNode": true,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"autoReleaseAssets": false,
|
||||
"_id": "af8d57ab-a380-41ca-a401-dd7f3b49bbf9"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Canvas",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 3
|
||||
},
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 8
|
||||
},
|
||||
{
|
||||
"__id__": 10
|
||||
},
|
||||
{
|
||||
"__id__": 12
|
||||
},
|
||||
{
|
||||
"__id__": 14
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 16
|
||||
},
|
||||
{
|
||||
"__id__": 17
|
||||
},
|
||||
{
|
||||
"__id__": 18
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1334,
|
||||
"height": 750
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
667,
|
||||
375,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "a5esZu+45LA5mBpvttspPD"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Main Camera",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 4
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1334,
|
||||
"height": 750
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
452.93128617926146,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Camera",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 3
|
||||
},
|
||||
"_enabled": true,
|
||||
"_cullingMask": 4294967295,
|
||||
"_clearFlags": 7,
|
||||
"_backgroundColor": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_depth": -1,
|
||||
"_zoomRatio": 1,
|
||||
"_targetTexture": null,
|
||||
"_fov": 60,
|
||||
"_orthoSize": 10,
|
||||
"_nearClip": 1,
|
||||
"_farClip": 4096,
|
||||
"_ortho": true,
|
||||
"_rect": {
|
||||
"__type__": "cc.Rect",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 1,
|
||||
"height": 1
|
||||
},
|
||||
"_renderStages": 1,
|
||||
"_alignWithScreen": true,
|
||||
"_id": "81GN3uXINKVLeW4+iKSlim"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "bg",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 6
|
||||
},
|
||||
{
|
||||
"__id__": 7
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 27,
|
||||
"g": 38,
|
||||
"b": 46,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1334,
|
||||
"height": 750
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "d4LICARiFHeJPnWFeP1weH"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "930ad2c0-4808-4a61-8b7c-54c2aa4d0463"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "61YMmCWDRNQaYzvH4DLy2Y"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 45,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 2,
|
||||
"_originalHeight": 2,
|
||||
"_id": "95PMe8dkZMt4BaWYx9kOpb"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "avatar_1",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 9
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 300,
|
||||
"height": 300
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-266.793,
|
||||
180,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "66shu6N+hF9qE6ilfcwSgo"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "b7472010-7cd5-4283-850b-736871179990"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "3dcHQR/Y5FabBDltigs3nz"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "avatar_1_circle",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 11
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 300,
|
||||
"height": 300
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-266.793,
|
||||
-165,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "24SuBODF5NtYOYIFiWE/Kl"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "448d6e3d-2011-476d-9d1b-e8dee41366e4"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "b7472010-7cd5-4283-850b-736871179990"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "10Z+hbnCFLZIvtwlcU1RIX"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "avatar_2",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 13
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 500,
|
||||
"height": 300
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
234.147,
|
||||
180,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "70+rUBhD9KjLatbWbpTC9k"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 12
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "d7094bdd-dd97-4879-a46b-242f1f6a8510"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "d8ZLKSlJhLdpqMG0K+prsi"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "avatar_2_circle",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 15
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 500,
|
||||
"height": 300
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
234.147,
|
||||
-165,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": "8fami0yJBM17MPhnEqn8ry"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 14
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "448d6e3d-2011-476d-9d1b-e8dee41366e4"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "d7094bdd-dd97-4879-a46b-242f1f6a8510"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": "f1NA/PpGpBzb6OD+eVcCJ9"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Canvas",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_designResolution": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 1334,
|
||||
"height": 750
|
||||
},
|
||||
"_fitWidth": false,
|
||||
"_fitHeight": true,
|
||||
"_id": "59Cd0ovbdF4byw5sbjJDx7"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 45,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": "29zXboiXFBKoIV4PQ2liTe"
|
||||
},
|
||||
{
|
||||
"__type__": "6b33a01MvpCe7oAqTa8OiHm",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"rectAvatar": {
|
||||
"__id__": 15
|
||||
},
|
||||
"_id": "a27jxMLodCKIdqKHwuBb3F"
|
||||
}
|
||||
]
|
7
assets/Scene/Circle_avatar/Circle_avatar.fire.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.6",
|
||||
"uuid": "af8d57ab-a380-41ca-a401-dd7f3b49bbf9",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
11
assets/Scene/Circle_avatar/Circle_avatar.ts
Normal file
@ -0,0 +1,11 @@
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class CircleAvatar extends cc.Component {
|
||||
@property(cc.Sprite)
|
||||
rectAvatar: cc.Sprite = null;
|
||||
|
||||
start() {
|
||||
this.rectAvatar.getMaterial(0).setProperty('wh_ratio', this.rectAvatar.node.width / this.rectAvatar.node.height);
|
||||
}
|
||||
}
|
9
assets/Scene/Circle_avatar/Circle_avatar.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.5",
|
||||
"uuid": "6b33ad35-32fa-427b-ba00-a936bc3a21e6",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Circle_avatar/Texture.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "15d70013-eefb-462c-8cf5-ded07495b4da",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
BIN
assets/Scene/Circle_avatar/Texture/avatar.jpeg
Normal file
After Width: | Height: | Size: 32 KiB |
36
assets/Scene/Circle_avatar/Texture/avatar.jpeg.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "b48871a0-86c8-41c7-9269-637dc2638e8b",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 677,
|
||||
"height": 677,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"avatar": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "b7472010-7cd5-4283-850b-736871179990",
|
||||
"rawTextureUuid": "b48871a0-86c8-41c7-9269-637dc2638e8b",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 677,
|
||||
"height": 677,
|
||||
"rawWidth": 677,
|
||||
"rawHeight": 677,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Circle_avatar/Texture/bg.png
Normal file
After Width: | Height: | Size: 241 KiB |
36
assets/Scene/Circle_avatar/Texture/bg.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "9716475d-8dcc-49a4-baa7-52b436822209",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 968,
|
||||
"height": 582,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"bg": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "d7094bdd-dd97-4879-a46b-242f1f6a8510",
|
||||
"rawTextureUuid": "9716475d-8dcc-49a4-baa7-52b436822209",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 968,
|
||||
"height": 582,
|
||||
"rawWidth": 968,
|
||||
"rawHeight": 582,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Circle_avatar/Texture/single_color.png
Normal file
After Width: | Height: | Size: 82 B |
36
assets/Scene/Circle_avatar/Texture/single_color.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "f79b7d26-a12e-4cc1-9316-0a9360cb15b9",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"single_color": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "930ad2c0-4808-4a61-8b7c-54c2aa4d0463",
|
||||
"rawTextureUuid": "f79b7d26-a12e-4cc1-9316-0a9360cb15b9",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"rawWidth": 2,
|
||||
"rawHeight": 2,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
108
assets/Scene/Circle_avatar/circle_avatar.effect
Normal file
@ -0,0 +1,108 @@
|
||||
CCEffect %{
|
||||
techniques:
|
||||
- passes:
|
||||
- vert: vs
|
||||
frag: fs
|
||||
blendState:
|
||||
targets:
|
||||
- blend: true
|
||||
rasterizerState:
|
||||
cullMode: none
|
||||
properties:
|
||||
texture: { value: white }
|
||||
wh_ratio: {
|
||||
value: 1,
|
||||
editor: {
|
||||
tooltip: "宽高比"
|
||||
}
|
||||
}
|
||||
blur: {
|
||||
value: 0.35,
|
||||
editor: {
|
||||
tooltip: "光圈模糊程度"
|
||||
}
|
||||
}
|
||||
radius: {
|
||||
value: 0.5,
|
||||
editor: {
|
||||
tooltip: "光圈半径"
|
||||
}
|
||||
}
|
||||
center: {
|
||||
value: [0.5, 0.5],
|
||||
editor: {
|
||||
tooltip: "光圈起点"
|
||||
}
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
CCProgram vs %{
|
||||
precision highp float;
|
||||
|
||||
#include <cc-global>
|
||||
#include <cc-local>
|
||||
|
||||
in vec3 a_position;
|
||||
in vec4 a_color;
|
||||
out vec4 v_color;
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 a_uv0;
|
||||
out vec2 v_uv0;
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 pos = vec4(a_position, 1);
|
||||
|
||||
#if CC_USE_MODEL
|
||||
pos = cc_matViewProj * cc_matWorld * pos;
|
||||
#else
|
||||
pos = cc_matViewProj * pos;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
v_uv0 = a_uv0;
|
||||
#endif
|
||||
|
||||
v_color = a_color;
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
}%
|
||||
|
||||
CCProgram fs %{
|
||||
|
||||
precision highp float;
|
||||
|
||||
#include <alpha-test>
|
||||
|
||||
in vec4 v_color;
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 v_uv0;
|
||||
uniform sampler2D texture;
|
||||
#endif
|
||||
|
||||
uniform ARGS{
|
||||
float radius;
|
||||
float blur;
|
||||
vec2 center;
|
||||
float wh_ratio;
|
||||
};
|
||||
|
||||
void main () {
|
||||
vec4 o = vec4(1, 1, 1, 1);
|
||||
o *= texture(texture, v_uv0);
|
||||
o *= v_color;
|
||||
|
||||
float circle = radius * radius;
|
||||
float rx = center.x * wh_ratio;
|
||||
float ry = center.y;
|
||||
float dis = (v_uv0.x * wh_ratio - rx) * (v_uv0.x * wh_ratio - rx) + (v_uv0.y - ry) * (v_uv0.y - ry);
|
||||
|
||||
o.a = smoothstep(circle, circle - blur, dis) * o.a;
|
||||
|
||||
gl_FragColor = o;
|
||||
}
|
||||
}%
|
17
assets/Scene/Circle_avatar/circle_avatar.effect.meta
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"ver": "1.0.25",
|
||||
"uuid": "78958555-477f-40d2-b500-4b91744f0f33",
|
||||
"compiledShaders": [
|
||||
{
|
||||
"glsl1": {
|
||||
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nuniform float radius;\nuniform float blur;\nuniform vec2 center;\nuniform float wh_ratio;\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n o *= texture2D(texture, v_uv0);\n o *= v_color;\n float circle = radius * radius;\n float rx = center.x * wh_ratio;\n float ry = center.y;\n float dis = (v_uv0.x * wh_ratio - rx) * (v_uv0.x * wh_ratio - rx) + (v_uv0.y - ry) * (v_uv0.y - ry);\n o.a = smoothstep(circle, circle - blur, dis) * o.a;\n gl_FragColor = o;\n}"
|
||||
},
|
||||
"glsl3": {
|
||||
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nuniform ARGS{\n float radius;\n float blur;\n vec2 center;\n float wh_ratio;\n};\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n o *= texture(texture, v_uv0);\n o *= v_color;\n float circle = radius * radius;\n float rx = center.x * wh_ratio;\n float ry = center.y;\n float dis = (v_uv0.x * wh_ratio - rx) * (v_uv0.x * wh_ratio - rx) + (v_uv0.y - ry) * (v_uv0.y - ry);\n o.a = smoothstep(circle, circle - blur, dis) * o.a;\n gl_FragColor = o;\n}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
20
assets/Scene/Circle_avatar/circle_avatar.mtl
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"__type__": "cc.Material",
|
||||
"_name": "circle_avatar",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"_effectAsset": {
|
||||
"__uuid__": "78958555-477f-40d2-b500-4b91744f0f33"
|
||||
},
|
||||
"_techniqueIndex": 0,
|
||||
"_techniqueData": {
|
||||
"0": {
|
||||
"defines": {
|
||||
"USE_TEXTURE": true
|
||||
},
|
||||
"props": {
|
||||
"blur": 0.01
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
6
assets/Scene/Circle_avatar/circle_avatar.mtl.meta
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"ver": "1.0.3",
|
||||
"uuid": "448d6e3d-2011-476d-9d1b-e8dee41366e4",
|
||||
"dataAsSubAsset": null,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Coin_fly_to_wallet.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "47d13c36-a8ef-4048-8886-c7f20ea310d1",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Coin_fly_to_wallet/Anim.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "2fe09b25-f8d3-4224-be15-24be6c15c6cd",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
55
assets/Scene/Coin_fly_to_wallet/Anim/coin.anim
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"__type__": "cc.AnimationClip",
|
||||
"_name": "coin",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"_duration": 1,
|
||||
"sample": 6,
|
||||
"speed": 1,
|
||||
"wrapMode": 2,
|
||||
"curveData": {
|
||||
"comps": {
|
||||
"cc.Sprite": {
|
||||
"spriteFrame": [
|
||||
{
|
||||
"frame": 0,
|
||||
"value": {
|
||||
"__uuid__": "28bb2e6a-615d-49b8-a336-b9da8d2a2171"
|
||||
}
|
||||
},
|
||||
{
|
||||
"frame": 0.16666666666666666,
|
||||
"value": {
|
||||
"__uuid__": "a2f151c4-4849-46a2-8de3-cf3daf82786d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"frame": 0.3333333333333333,
|
||||
"value": {
|
||||
"__uuid__": "7c516296-1a47-4557-967b-cb755c885c0b"
|
||||
}
|
||||
},
|
||||
{
|
||||
"frame": 0.5,
|
||||
"value": {
|
||||
"__uuid__": "3b00549c-9d1c-479f-9a4a-3c5a65d8dd19"
|
||||
}
|
||||
},
|
||||
{
|
||||
"frame": 0.6666666666666666,
|
||||
"value": {
|
||||
"__uuid__": "101f2e9d-800b-4a4a-b470-ac3b9a7f343b"
|
||||
}
|
||||
},
|
||||
{
|
||||
"frame": 0.8333333333333334,
|
||||
"value": {
|
||||
"__uuid__": "61a9a149-e55f-4fc5-8368-1f809db4d86a"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"events": []
|
||||
}
|
5
assets/Scene/Coin_fly_to_wallet/Anim/coin.anim.meta
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ver": "2.1.0",
|
||||
"uuid": "c05a7266-2da0-4fc5-95fe-6fc1eea52cd0",
|
||||
"subMetas": {}
|
||||
}
|
1326
assets/Scene/Coin_fly_to_wallet/Coin_fly_to_wallet.fire
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.6",
|
||||
"uuid": "e59f7c21-d36e-47ba-82ef-810c834009a2",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
93
assets/Scene/Coin_fly_to_wallet/Coin_fly_to_wallet.ts
Normal file
@ -0,0 +1,93 @@
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Coin_fly_to_wallet extends cc.Component {
|
||||
@property(cc.Node)
|
||||
startPoint: cc.Node = null;
|
||||
@property(cc.Node)
|
||||
endPoint: cc.Node = null;
|
||||
@property(cc.Prefab)
|
||||
coinPrefab: cc.Prefab = null;
|
||||
|
||||
coinPool: cc.NodePool = null;
|
||||
|
||||
onLoad() {
|
||||
this.coinPool = new cc.NodePool();
|
||||
this.initCoinPool();
|
||||
}
|
||||
|
||||
initCoinPool(count: number = 20) {
|
||||
for (let i = 0; i < count; i++) {
|
||||
let coin = cc.instantiate(this.coinPrefab);
|
||||
this.coinPool.put(coin);
|
||||
}
|
||||
}
|
||||
|
||||
playAnim() {
|
||||
let randomCount = Math.random() * 15 + 10;
|
||||
let stPos = this.startPoint.getPosition();
|
||||
let edPos = this.endPoint.getPosition();
|
||||
this.playCoinFlyAnim(randomCount, stPos, edPos);
|
||||
}
|
||||
|
||||
playCoinFlyAnim(count: number, stPos: cc.Vec2, edPos: cc.Vec2, r: number = 130) {
|
||||
// 确保当前节点池有足够的金币
|
||||
const poolSize = this.coinPool.size();
|
||||
const reCreateCoinCount = poolSize > count ? 0 : count - poolSize;
|
||||
this.initCoinPool(reCreateCoinCount);
|
||||
|
||||
// 生成圆,并且对圆上的点进行排序
|
||||
let points = this.getCirclePoints(r, stPos, count);
|
||||
let coinNodeList = points.map(pos => {
|
||||
let coin = this.coinPool.get();
|
||||
coin.setPosition(stPos);
|
||||
this.node.addChild(coin);
|
||||
return {
|
||||
node: coin,
|
||||
stPos: stPos,
|
||||
mdPos: pos,
|
||||
edPos: edPos,
|
||||
dis: (pos as any).sub(edPos).mag()
|
||||
};
|
||||
});
|
||||
coinNodeList = coinNodeList.sort((a, b) => {
|
||||
if (a.dis - b.dis > 0) return 1;
|
||||
if (a.dis - b.dis < 0) return -1;
|
||||
return 0;
|
||||
});
|
||||
|
||||
// 执行金币落袋的动画
|
||||
coinNodeList.forEach((item, idx) => {
|
||||
item.node.runAction(
|
||||
cc.sequence(
|
||||
cc.moveTo(0.3, item.mdPos),
|
||||
cc.delayTime(idx * 0.01),
|
||||
cc.moveTo(0.5, item.edPos),
|
||||
cc.callFunc(() => {
|
||||
this.coinPool.put(item.node);
|
||||
})
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 以某点为圆心,生成圆周上等分点的坐标
|
||||
*
|
||||
* @param {number} r 半径
|
||||
* @param {cc.Vec2} pos 圆心坐标
|
||||
* @param {number} count 等分点数量
|
||||
* @param {number} [randomScope=80] 等分点的随机波动范围
|
||||
* @returns {cc.Vec2[]} 返回等分点坐标
|
||||
*/
|
||||
getCirclePoints(r: number, pos: cc.Vec2, count: number, randomScope: number = 60): cc.Vec2[] {
|
||||
let points = [];
|
||||
let radians = (Math.PI / 180) * Math.round(360 / count);
|
||||
for (let i = 0; i < count; i++) {
|
||||
let x = pos.x + r * Math.sin(radians * i);
|
||||
let y = pos.y + r * Math.cos(radians * i);
|
||||
points.unshift(cc.v3(x + Math.random() * randomScope, y + Math.random() * randomScope, 0));
|
||||
}
|
||||
return points;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.5",
|
||||
"uuid": "e54af7d4-17b3-4679-9cad-3457302e139d",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Coin_fly_to_wallet/Prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "aef1340b-5d54-4592-9d0d-283220ebf9cb",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
143
assets/Scene/Coin_fly_to_wallet/Prefab/coin.prefab
Normal file
@ -0,0 +1,143 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "coin",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 60,
|
||||
"height": 60
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "28bb2e6a-615d-49b8-a336-b9da8d2a2171"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 1,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": {
|
||||
"__uuid__": "1a062e1b-0e93-4cff-be58-9517555b09f5"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Animation",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_defaultClip": {
|
||||
"__uuid__": "c05a7266-2da0-4fc5-95fe-6fc1eea52cd0"
|
||||
},
|
||||
"_clips": [
|
||||
{
|
||||
"__uuid__": "c05a7266-2da0-4fc5-95fe-6fc1eea52cd0"
|
||||
}
|
||||
],
|
||||
"playOnLoad": true,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "fca82ecc-ae07-410f-8658-ce7fc8e9d2d3"
|
||||
},
|
||||
"fileId": "f9P6h6OM9Glbsc4bkBmFtn",
|
||||
"sync": false
|
||||
}
|
||||
]
|
8
assets/Scene/Coin_fly_to_wallet/Prefab/coin.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.6",
|
||||
"uuid": "fca82ecc-ae07-410f-8658-ce7fc8e9d2d3",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Coin_fly_to_wallet/Texture.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "07c3b8ca-280e-4457-9def-57ef7e082777",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
100
assets/Scene/Coin_fly_to_wallet/Texture/goldAnim.plist
Normal file
@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>frames</key>
|
||||
<dict>
|
||||
<key>jb1.png</key>
|
||||
<dict>
|
||||
<key>frame</key>
|
||||
<string>{{2,2},{60,60}}</string>
|
||||
<key>offset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>rotated</key>
|
||||
<false/>
|
||||
<key>sourceColorRect</key>
|
||||
<string>{{0,0},{60,60}}</string>
|
||||
<key>sourceSize</key>
|
||||
<string>{60,60}</string>
|
||||
</dict>
|
||||
<key>jb2.png</key>
|
||||
<dict>
|
||||
<key>frame</key>
|
||||
<string>{{64,60},{56,60}}</string>
|
||||
<key>offset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>rotated</key>
|
||||
<true/>
|
||||
<key>sourceColorRect</key>
|
||||
<string>{{0,0},{56,60}}</string>
|
||||
<key>sourceSize</key>
|
||||
<string>{56,60}</string>
|
||||
</dict>
|
||||
<key>jb3.png</key>
|
||||
<dict>
|
||||
<key>frame</key>
|
||||
<string>{{2,102},{36,60}}</string>
|
||||
<key>offset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>rotated</key>
|
||||
<true/>
|
||||
<key>sourceColorRect</key>
|
||||
<string>{{0,0},{36,60}}</string>
|
||||
<key>sourceSize</key>
|
||||
<string>{36,60}</string>
|
||||
</dict>
|
||||
<key>jb4.png</key>
|
||||
<dict>
|
||||
<key>frame</key>
|
||||
<string>{{64,118},{13,60}}</string>
|
||||
<key>offset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>rotated</key>
|
||||
<true/>
|
||||
<key>sourceColorRect</key>
|
||||
<string>{{0,0},{13,60}}</string>
|
||||
<key>sourceSize</key>
|
||||
<string>{13,60}</string>
|
||||
</dict>
|
||||
<key>jb5.png</key>
|
||||
<dict>
|
||||
<key>frame</key>
|
||||
<string>{{2,64},{36,60}}</string>
|
||||
<key>offset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>rotated</key>
|
||||
<true/>
|
||||
<key>sourceColorRect</key>
|
||||
<string>{{0,0},{36,60}}</string>
|
||||
<key>sourceSize</key>
|
||||
<string>{36,60}</string>
|
||||
</dict>
|
||||
<key>jb6.png</key>
|
||||
<dict>
|
||||
<key>frame</key>
|
||||
<string>{{64,2},{56,60}}</string>
|
||||
<key>offset</key>
|
||||
<string>{0,0}</string>
|
||||
<key>rotated</key>
|
||||
<true/>
|
||||
<key>sourceColorRect</key>
|
||||
<string>{{0,0},{56,60}}</string>
|
||||
<key>sourceSize</key>
|
||||
<string>{56,60}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>metadata</key>
|
||||
<dict>
|
||||
<key>format</key>
|
||||
<integer>2</integer>
|
||||
<key>realTextureFileName</key>
|
||||
<string>goldAnim.png</string>
|
||||
<key>size</key>
|
||||
<string>{128,256}</string>
|
||||
<key>smartupdate</key>
|
||||
<string>$TexturePacker:SmartUpdate:174c3bcf2102596fc16f1743450236e8$</string>
|
||||
<key>textureFileName</key>
|
||||
<string>goldAnim.png</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
144
assets/Scene/Coin_fly_to_wallet/Texture/goldAnim.plist.meta
Normal file
@ -0,0 +1,144 @@
|
||||
{
|
||||
"ver": "1.2.4",
|
||||
"uuid": "1a062e1b-0e93-4cff-be58-9517555b09f5",
|
||||
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
|
||||
"size": {
|
||||
"width": 128,
|
||||
"height": 256
|
||||
},
|
||||
"type": "Texture Packer",
|
||||
"subMetas": {
|
||||
"jb1.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "28bb2e6a-615d-49b8-a336-b9da8d2a2171",
|
||||
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 2,
|
||||
"trimY": 2,
|
||||
"width": 60,
|
||||
"height": 60,
|
||||
"rawWidth": 60,
|
||||
"rawHeight": 60,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"jb2.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "61a9a149-e55f-4fc5-8368-1f809db4d86a",
|
||||
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 64,
|
||||
"trimY": 60,
|
||||
"width": 56,
|
||||
"height": 60,
|
||||
"rawWidth": 56,
|
||||
"rawHeight": 60,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"jb3.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "101f2e9d-800b-4a4a-b470-ac3b9a7f343b",
|
||||
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 2,
|
||||
"trimY": 102,
|
||||
"width": 36,
|
||||
"height": 60,
|
||||
"rawWidth": 36,
|
||||
"rawHeight": 60,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"jb4.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "3b00549c-9d1c-479f-9a4a-3c5a65d8dd19",
|
||||
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 64,
|
||||
"trimY": 118,
|
||||
"width": 13,
|
||||
"height": 60,
|
||||
"rawWidth": 13,
|
||||
"rawHeight": 60,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"jb5.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "7c516296-1a47-4557-967b-cb755c885c0b",
|
||||
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 2,
|
||||
"trimY": 64,
|
||||
"width": 36,
|
||||
"height": 60,
|
||||
"rawWidth": 36,
|
||||
"rawHeight": 60,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
},
|
||||
"jb6.png": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "a2f151c4-4849-46a2-8de3-cf3daf82786d",
|
||||
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": true,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 64,
|
||||
"trimY": 2,
|
||||
"width": 56,
|
||||
"height": 60,
|
||||
"rawWidth": 56,
|
||||
"rawHeight": 60,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"spriteType": "normal",
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Coin_fly_to_wallet/Texture/goldAnim.png
Normal file
After Width: | Height: | Size: 17 KiB |
14
assets/Scene/Coin_fly_to_wallet/Texture/goldAnim.png.meta
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
|
||||
"type": "raw",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 128,
|
||||
"height": 256,
|
||||
"platformSettings": {},
|
||||
"subMetas": {}
|
||||
}
|
BIN
assets/Scene/Coin_fly_to_wallet/Texture/singleColor.png
Normal file
After Width: | Height: | Size: 82 B |
36
assets/Scene/Coin_fly_to_wallet/Texture/singleColor.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"singleColor": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "410fb916-8721-4663-bab8-34397391ace7",
|
||||
"rawTextureUuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"rawWidth": 2,
|
||||
"rawHeight": 2,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
7
assets/Scene/Dissolve_color.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "9ac455c6-8cbe-4f0c-9cad-762448ba9a98",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
1095
assets/Scene/Dissolve_color/Dissolve_color.fire
Normal file
7
assets/Scene/Dissolve_color/Dissolve_color.fire.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.6",
|
||||
"uuid": "22cbd783-dfc9-4daa-bd69-2ef24d6b787b",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
38
assets/Scene/Dissolve_color/Dissolve_color.ts
Normal file
@ -0,0 +1,38 @@
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Dissolve_color extends cc.Component {
|
||||
@property(cc.Label)
|
||||
tip: cc.Label = null;
|
||||
materialList: cc.Material[] = [];
|
||||
fadePct: number = 0; // 溶解百分比
|
||||
activeFlag: boolean = false; // 溶解进行中
|
||||
symbol: number = 1; // 色彩叠加的正负
|
||||
speed: number = 0.5; // 色彩叠加的速度
|
||||
|
||||
start() {
|
||||
this.materialList.push(
|
||||
this.node.getChildByName('ghost').getComponent(cc.Sprite).getMaterial(0),
|
||||
this.node.getChildByName('man').getComponent(cc.Sprite).getMaterial(0)
|
||||
);
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if (this.activeFlag) return;
|
||||
this.activeFlag = true;
|
||||
}
|
||||
|
||||
update(dt) {
|
||||
if (!this.activeFlag) return;
|
||||
this.materialList.forEach((material) => material.setProperty('fade_pct', this.fadePct));
|
||||
|
||||
if (this.fadePct >= 0 && this.fadePct <= 1) {
|
||||
this.fadePct += this.symbol * dt * this.speed;
|
||||
this.tip.string = "溶解程度 " + this.fadePct.toFixed(1);
|
||||
} else {
|
||||
this.fadePct = this.fadePct > 1 ? 1 : 0;
|
||||
this.symbol = -this.symbol;
|
||||
this.activeFlag = false;
|
||||
}
|
||||
}
|
||||
}
|
9
assets/Scene/Dissolve_color/Dissolve_color.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.5",
|
||||
"uuid": "184abf81-21e5-424c-bbdd-f051fa07e877",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Dissolve_color/Texture.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "b30bb05b-8aa6-491f-bbcf-66092cfa0534",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
BIN
assets/Scene/Dissolve_color/Texture/ghost.png
Normal file
After Width: | Height: | Size: 20 KiB |
36
assets/Scene/Dissolve_color/Texture/ghost.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "32148d04-fd60-44fe-a08c-d8b34fd2c8cb",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 115,
|
||||
"height": 192,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"ghost": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "218c096b-8d5f-4f9f-b4e8-d27fda083dba",
|
||||
"rawTextureUuid": "32148d04-fd60-44fe-a08c-d8b34fd2c8cb",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 7,
|
||||
"offsetY": 0,
|
||||
"trimX": 14,
|
||||
"trimY": 1,
|
||||
"width": 101,
|
||||
"height": 190,
|
||||
"rawWidth": 115,
|
||||
"rawHeight": 192,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Dissolve_color/Texture/man.png
Normal file
After Width: | Height: | Size: 137 KiB |
36
assets/Scene/Dissolve_color/Texture/man.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "7c6bb59a-7592-48e1-8d5c-6b19fcd2ea48",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 570,
|
||||
"height": 640,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"man": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "f04700ab-da53-4639-98a2-d8eefffe7c15",
|
||||
"rawTextureUuid": "7c6bb59a-7592-48e1-8d5c-6b19fcd2ea48",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": -1,
|
||||
"offsetY": -24,
|
||||
"trimX": 120,
|
||||
"trimY": 88,
|
||||
"width": 328,
|
||||
"height": 512,
|
||||
"rawWidth": 570,
|
||||
"rawHeight": 640,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Dissolve_color/Texture/single_color.png
Normal file
After Width: | Height: | Size: 82 B |
36
assets/Scene/Dissolve_color/Texture/single_color.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "ff5737ae-78d9-472c-8223-3f96d686720c",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"single_color": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "f356aba1-884e-4022-abc4-c90c2a285f56",
|
||||
"rawTextureUuid": "ff5737ae-78d9-472c-8223-3f96d686720c",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"rawWidth": 2,
|
||||
"rawHeight": 2,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
86
assets/Scene/Dissolve_color/dissolve_color.effect
Normal file
@ -0,0 +1,86 @@
|
||||
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
CCEffect %{
|
||||
techniques:
|
||||
- passes:
|
||||
- vert: vs
|
||||
frag: fs
|
||||
blendState:
|
||||
targets:
|
||||
- blend: true
|
||||
rasterizerState:
|
||||
cullMode: none
|
||||
properties:
|
||||
texture: { value: white }
|
||||
fade_pct: { value: 1.0 }
|
||||
}%
|
||||
|
||||
|
||||
CCProgram vs %{
|
||||
precision highp float;
|
||||
|
||||
#include <cc-global>
|
||||
#include <cc-local>
|
||||
|
||||
in vec3 a_position;
|
||||
in vec4 a_color;
|
||||
out vec4 v_color;
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 a_uv0;
|
||||
out vec2 v_uv0;
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 pos = vec4(a_position, 1);
|
||||
|
||||
#if CC_USE_MODEL
|
||||
pos = cc_matViewProj * cc_matWorld * pos;
|
||||
#else
|
||||
pos = cc_matViewProj * pos;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
v_uv0 = a_uv0;
|
||||
#endif
|
||||
|
||||
v_color = a_color;
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
CCProgram fs %{
|
||||
precision highp float;
|
||||
|
||||
#include <alpha-test>
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 v_uv0;
|
||||
uniform sampler2D texture;
|
||||
uniform ARGS {
|
||||
float fade_pct;
|
||||
};
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 color = vec4(1, 1, 1, 1);
|
||||
|
||||
#if USE_TEXTURE
|
||||
color *= texture(texture, v_uv0);
|
||||
#if CC_USE_ALPHA_ATLAS_TEXTURE
|
||||
color.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// 当颜色小于溶解的程度,则直接抛弃
|
||||
if(color.b < fade_pct) discard;
|
||||
if(color.b < fade_pct + 0.1) {
|
||||
// 对溶解的边缘做处理,变色或者改透明度等等
|
||||
color = color * vec4(0.92, 0.8, 0.95, color.a);
|
||||
}
|
||||
|
||||
gl_FragColor = color;
|
||||
}
|
||||
}%
|
17
assets/Scene/Dissolve_color/dissolve_color.effect.meta
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"ver": "1.0.25",
|
||||
"uuid": "8f11426c-8971-4082-b9b9-56ab5fb4bc9a",
|
||||
"compiledShaders": [
|
||||
{
|
||||
"glsl1": {
|
||||
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n#endif\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\nuniform float fade_pct;\n#endif\nvoid main () {\n vec4 color = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n color *= texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n color.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n if(color.b < fade_pct) discard;\n if(color.b < fade_pct + 0.1) {\n color = color * vec4(0.92, 0.8, 0.95, color.a);\n }\n gl_FragColor = color;\n}"
|
||||
},
|
||||
"glsl3": {
|
||||
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\nuniform ARGS {\n float fade_pct;\n};\n#endif\nvoid main () {\n vec4 color = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n color *= texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n color.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #endif\n if(color.b < fade_pct) discard;\n if(color.b < fade_pct + 0.1) {\n color = color * vec4(0.92, 0.8, 0.95, color.a);\n }\n gl_FragColor = color;\n}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
20
assets/Scene/Dissolve_color/dissolve_color.mtl
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"__type__": "cc.Material",
|
||||
"_name": "dissolve_color",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"_effectAsset": {
|
||||
"__uuid__": "8f11426c-8971-4082-b9b9-56ab5fb4bc9a"
|
||||
},
|
||||
"_techniqueIndex": 0,
|
||||
"_techniqueData": {
|
||||
"0": {
|
||||
"defines": {
|
||||
"USE_TEXTURE": true
|
||||
},
|
||||
"props": {
|
||||
"fade_pct": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
6
assets/Scene/Dissolve_color/dissolve_color.mtl.meta
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"ver": "1.0.3",
|
||||
"uuid": "fa6f370c-414d-468b-ad8b-7ac31ff369d5",
|
||||
"dataAsSubAsset": null,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Filter.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "d4ddaecb-2dc5-417c-ae6c-a7b23adf580e",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
1571
assets/Scene/Filter/Filter.fire
Normal file
7
assets/Scene/Filter/Filter.fire.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.6",
|
||||
"uuid": "b23d729e-ccd3-45cc-b478-e555f5c92388",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
7
assets/Scene/Filter/Texture.meta
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"uuid": "d1d1b569-80e8-4b7e-9cbe-87b4f79d0e8e",
|
||||
"isSubpackage": false,
|
||||
"subpackageName": "",
|
||||
"subMetas": {}
|
||||
}
|
BIN
assets/Scene/Filter/Texture/bg.png
Normal file
After Width: | Height: | Size: 91 B |
36
assets/Scene/Filter/Texture/bg.png.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "b09cc4b6-a8f3-4236-9c6b-0686fc3d765e",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": false,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"bg": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "5640ff1a-66dc-4ba9-b0e5-8be4190a3333",
|
||||
"rawTextureUuid": "b09cc4b6-a8f3-4236-9c6b-0686fc3d765e",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"rawWidth": 2,
|
||||
"rawHeight": 2,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/Scene/Filter/Texture/img.jpg
Normal file
After Width: | Height: | Size: 30 KiB |
36
assets/Scene/Filter/Texture/img.jpg.meta
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.4",
|
||||
"uuid": "07eb0dc1-20cb-4ea6-aff1-1eda4bc174fd",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 500,
|
||||
"height": 375,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"img": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "47667903-c979-4668-b039-50fe9a95c12a",
|
||||
"rawTextureUuid": "07eb0dc1-20cb-4ea6-aff1-1eda4bc174fd",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 500,
|
||||
"height": 375,
|
||||
"rawWidth": 500,
|
||||
"rawHeight": 375,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
73
assets/Scene/Filter/brown.effect
Normal file
@ -0,0 +1,73 @@
|
||||
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
CCEffect %{
|
||||
techniques:
|
||||
- passes:
|
||||
- vert: vs
|
||||
frag: fs
|
||||
blendState:
|
||||
targets:
|
||||
- blend: true
|
||||
rasterizerState:
|
||||
cullMode: none
|
||||
properties:
|
||||
texture: { value: white }
|
||||
}%
|
||||
|
||||
|
||||
CCProgram vs %{
|
||||
precision highp float;
|
||||
|
||||
#include <cc-global>
|
||||
#include <cc-local>
|
||||
|
||||
in vec3 a_position;
|
||||
in vec4 a_color;
|
||||
out vec4 v_color;
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 a_uv0;
|
||||
out vec2 v_uv0;
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 pos = vec4(a_position, 1);
|
||||
|
||||
#if CC_USE_MODEL
|
||||
pos = cc_matViewProj * cc_matWorld * pos;
|
||||
#else
|
||||
pos = cc_matViewProj * pos;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
v_uv0 = a_uv0;
|
||||
#endif
|
||||
|
||||
v_color = a_color;
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
CCProgram fs %{
|
||||
precision highp float;
|
||||
|
||||
#include <alpha-test>
|
||||
|
||||
in vec4 v_color;
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 v_uv0;
|
||||
uniform sampler2D texture;
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 color = texture(texture, v_uv0);
|
||||
float _r = color.r * 0.393 + color.g * 0.769 + color.b * 0.189;
|
||||
float _g = color.r * 0.349 + color.g * 0.686 + color.b * 0.168;
|
||||
float _b = color.r * 0.272 + color.g * 0.534 + color.b * 0.131;
|
||||
color = vec4(_r, _g, _b, color.a);
|
||||
gl_FragColor = color;
|
||||
}
|
||||
}%
|
17
assets/Scene/Filter/brown.effect.meta
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"ver": "1.0.25",
|
||||
"uuid": "dd3a8417-d752-4cf1-9c45-f9ee3c0bf858",
|
||||
"compiledShaders": [
|
||||
{
|
||||
"glsl1": {
|
||||
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture2D(texture, v_uv0);\n float _r = color.r * 0.393 + color.g * 0.769 + color.b * 0.189;\n float _g = color.r * 0.349 + color.g * 0.686 + color.b * 0.168;\n float _b = color.r * 0.272 + color.g * 0.534 + color.b * 0.131;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\n}"
|
||||
},
|
||||
"glsl3": {
|
||||
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture(texture, v_uv0);\n float _r = color.r * 0.393 + color.g * 0.769 + color.b * 0.189;\n float _g = color.r * 0.349 + color.g * 0.686 + color.b * 0.168;\n float _b = color.r * 0.272 + color.g * 0.534 + color.b * 0.131;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\n}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
19
assets/Scene/Filter/brown.mtl
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"__type__": "cc.Material",
|
||||
"_name": "New Material",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"_effectAsset": {
|
||||
"__uuid__": "dd3a8417-d752-4cf1-9c45-f9ee3c0bf858"
|
||||
},
|
||||
"_techniqueIndex": 0,
|
||||
"_techniqueData": {
|
||||
"0": {
|
||||
"defines": {
|
||||
"USE_TEXTURE": true,
|
||||
"USE_ALPHA_TEST": false
|
||||
},
|
||||
"props": {}
|
||||
}
|
||||
}
|
||||
}
|
6
assets/Scene/Filter/brown.mtl.meta
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"ver": "1.0.3",
|
||||
"uuid": "e697bd51-81a4-4e3a-9e4c-cdef6af6e7ca",
|
||||
"dataAsSubAsset": null,
|
||||
"subMetas": {}
|
||||
}
|
73
assets/Scene/Filter/cartoon.effect
Normal file
@ -0,0 +1,73 @@
|
||||
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
CCEffect %{
|
||||
techniques:
|
||||
- passes:
|
||||
- vert: vs
|
||||
frag: fs
|
||||
blendState:
|
||||
targets:
|
||||
- blend: true
|
||||
rasterizerState:
|
||||
cullMode: none
|
||||
properties:
|
||||
texture: { value: white }
|
||||
alphaThreshold: { value: 0.5 }
|
||||
}%
|
||||
|
||||
|
||||
CCProgram vs %{
|
||||
precision highp float;
|
||||
|
||||
#include <cc-global>
|
||||
#include <cc-local>
|
||||
|
||||
in vec3 a_position;
|
||||
in vec4 a_color;
|
||||
out vec4 v_color;
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 a_uv0;
|
||||
out vec2 v_uv0;
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 pos = vec4(a_position, 1);
|
||||
|
||||
#if CC_USE_MODEL
|
||||
pos = cc_matViewProj * cc_matWorld * pos;
|
||||
#else
|
||||
pos = cc_matViewProj * pos;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
v_uv0 = a_uv0;
|
||||
#endif
|
||||
|
||||
v_color = a_color;
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
CCProgram fs %{
|
||||
precision highp float;
|
||||
|
||||
#include <alpha-test>
|
||||
in vec4 v_color;
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 v_uv0;
|
||||
uniform sampler2D texture;
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 color = texture(texture, v_uv0);
|
||||
float _r = abs(color.g - color.b + color.g + color.r) * color.r;
|
||||
float _g = abs(color.b - color.g + color.b + color.r) * color.r;
|
||||
float _b = abs(color.b - color.g + color.b + color.r) * color.g;
|
||||
color = vec4(_r, _g, _b, color.a);
|
||||
gl_FragColor = color;
|
||||
}
|
||||
}%
|
17
assets/Scene/Filter/cartoon.effect.meta
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"ver": "1.0.25",
|
||||
"uuid": "1410dc1a-1903-435f-bf7a-35e48ca53fd6",
|
||||
"compiledShaders": [
|
||||
{
|
||||
"glsl1": {
|
||||
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture2D(texture, v_uv0);\n float _r = abs(color.g - color.b + color.g + color.r) * color.r;\n float _g = abs(color.b - color.g + color.b + color.r) * color.r;\n float _b = abs(color.b - color.g + color.b + color.r) * color.g;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\n}"
|
||||
},
|
||||
"glsl3": {
|
||||
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
|
||||
"frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nvoid main () {\n vec4 color = texture(texture, v_uv0);\n float _r = abs(color.g - color.b + color.g + color.r) * color.r;\n float _g = abs(color.b - color.g + color.b + color.r) * color.r;\n float _b = abs(color.b - color.g + color.b + color.r) * color.g;\n color = vec4(_r, _g, _b, color.a);\n gl_FragColor = color;\n}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
17
assets/Scene/Filter/cartoon.mtl
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"__type__": "cc.Material",
|
||||
"_name": "cartoon",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"_effectAsset": {
|
||||
"__uuid__": "1410dc1a-1903-435f-bf7a-35e48ca53fd6"
|
||||
},
|
||||
"_techniqueIndex": 0,
|
||||
"_techniqueData": {
|
||||
"0": {
|
||||
"defines": {
|
||||
"USE_TEXTURE": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
6
assets/Scene/Filter/cartoon.mtl.meta
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"ver": "1.0.3",
|
||||
"uuid": "33274f30-e75f-40b1-ac3f-cea71b7ba496",
|
||||
"dataAsSubAsset": null,
|
||||
"subMetas": {}
|
||||
}
|
75
assets/Scene/Filter/frozen.effect
Normal file
@ -0,0 +1,75 @@
|
||||
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
CCEffect %{
|
||||
techniques:
|
||||
- passes:
|
||||
- vert: vs
|
||||
frag: fs
|
||||
blendState:
|
||||
targets:
|
||||
- blend: true
|
||||
rasterizerState:
|
||||
cullMode: none
|
||||
properties:
|
||||
texture: { value: white }
|
||||
alphaThreshold: { value: 0.5 }
|
||||
}%
|
||||
|
||||
|
||||
CCProgram vs %{
|
||||
precision highp float;
|
||||
|
||||
#include <cc-global>
|
||||
#include <cc-local>
|
||||
|
||||
in vec3 a_position;
|
||||
in vec4 a_color;
|
||||
out vec4 v_color;
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 a_uv0;
|
||||
out vec2 v_uv0;
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
vec4 pos = vec4(a_position, 1);
|
||||
|
||||
#if CC_USE_MODEL
|
||||
pos = cc_matViewProj * cc_matWorld * pos;
|
||||
#else
|
||||
pos = cc_matViewProj * pos;
|
||||
#endif
|
||||
|
||||
#if USE_TEXTURE
|
||||
v_uv0 = a_uv0;
|
||||
#endif
|
||||
|
||||
v_color = a_color;
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
CCProgram fs %{
|
||||
precision highp float;
|
||||
|
||||
#include <alpha-test>
|
||||
|
||||
in vec4 v_color;
|
||||
|
||||
#if USE_TEXTURE
|
||||
in vec2 v_uv0;
|
||||
uniform sampler2D texture;
|
||||
#endif
|
||||
|
||||
void main () {
|
||||
// 冰冻
|
||||
vec4 color = texture(texture, v_uv0);
|
||||
float r = abs(color.r - color.g - color.b) * 1.5;
|
||||
float g = abs(color.g - color.b - color.r) * 1.5;
|
||||
float b = abs(color.b - color.r - color.g) * 1.5;
|
||||
color = vec4(r, g, b, color.a);
|
||||
gl_FragColor = color;
|
||||
}
|
||||
}%
|