Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
M
MusicBigWatermelon
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
MusicBigWatermelon
Commits
fb7e49e5
Commit
fb7e49e5
authored
Aug 02, 2021
by
LiLiuZhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
a06160ca
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
149 additions
and
1 deletion
+149
-1
Notes.spriteatlas
Assets/Resources/Atlas/Notes.spriteatlas
+47
-0
Notes.spriteatlas.meta
Assets/Resources/Atlas/Notes.spriteatlas.meta
+8
-0
Note.prefab
Assets/Resources/Prefabs/Note.prefab
+76
-0
Note.prefab.meta
Assets/Resources/Prefabs/Note.prefab.meta
+7
-0
Fruit.cs
Assets/Scripts/Game/Fruit.cs
+11
-1
No files found.
Assets/Resources/Atlas/Notes.spriteatlas
0 → 100644
View file @
fb7e49e5
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!687078895
&4343727234628468602
SpriteAtlas
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
Notes
m_EditorData
:
serializedVersion
:
2
textureSettings
:
serializedVersion
:
2
anisoLevel
:
1
compressionQuality
:
50
maxTextureSize
:
2048
textureCompression
:
0
filterMode
:
1
generateMipMaps
:
0
readable
:
0
crunchedCompression
:
0
sRGB
:
1
platformSettings
:
[]
packingSettings
:
serializedVersion
:
2
padding
:
4
blockOffset
:
1
allowAlphaSplitting
:
0
enableRotation
:
0
enableTightPacking
:
0
variantMultiplier
:
1
packables
:
-
{
fileID
:
21300000
,
guid
:
39705d929dfda5040a9b0628dc0ed7f7
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
75805f8d3dcfc2648a4907ab6188ad96
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
a8b467a8e79625e49b7023066fd5296e
,
type
:
3
}
bindAsDefault
:
1
m_MasterAtlas
:
{
fileID
:
0
}
m_PackedSprites
:
-
{
fileID
:
21300000
,
guid
:
39705d929dfda5040a9b0628dc0ed7f7
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
a8b467a8e79625e49b7023066fd5296e
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
75805f8d3dcfc2648a4907ab6188ad96
,
type
:
3
}
m_PackedSpriteNamesToIndex
:
-
note1
-
note3
-
note2
m_Tag
:
Notes
m_IsVariant
:
0
Assets/Resources/Atlas/Notes.spriteatlas.meta
0 → 100644
View file @
fb7e49e5
fileFormatVersion: 2
guid: 2ec33cb222d652940a8efb0893c35d41
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4343727234628468602
userData:
assetBundleName:
assetBundleVariant:
Assets/Resources/Prefabs/Note.prefab
0 → 100644
View file @
fb7e49e5
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&4478431457881342505
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
2322622841654654539
}
-
component
:
{
fileID
:
4218146622977126899
}
-
component
:
{
fileID
:
4449185068710231341
}
m_Layer
:
5
m_Name
:
Note
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&2322622841654654539
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4478431457881342505
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
-24
,
y
:
-29.2
}
m_SizeDelta
:
{
x
:
160
,
y
:
190
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&4218146622977126899
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4478431457881342505
}
m_CullTransparentMesh
:
0
---
!u!114
&4449185068710231341
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4478431457881342505
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
fe87c0e1cc204ed48ad3b37840f39efc
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
m_Material
:
{
fileID
:
0
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_RaycastTarget
:
0
m_Maskable
:
1
m_OnCullStateChanged
:
m_PersistentCalls
:
m_Calls
:
[]
m_Sprite
:
{
fileID
:
21300000
,
guid
:
a8b467a8e79625e49b7023066fd5296e
,
type
:
3
}
m_Type
:
0
m_PreserveAspect
:
1
m_FillCenter
:
1
m_FillMethod
:
4
m_FillAmount
:
1
m_FillClockwise
:
1
m_FillOrigin
:
0
m_UseSpriteMesh
:
0
m_PixelsPerUnitMultiplier
:
1
Assets/Resources/Prefabs/Note.prefab.meta
0 → 100644
View file @
fb7e49e5
fileFormatVersion: 2
guid: a45e0a63406dc34478ea74bdb8c9e186
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Game/Fruit.cs
View file @
fb7e49e5
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.U2D
;
using
UnityEngine.UI
;
[RequireComponent(typeof(CircleCollider2D))]
[RequireComponent(typeof(CircleCollider2D))]
[RequireComponent(typeof(Rigidbody2D))]
[RequireComponent(typeof(Rigidbody2D))]
...
@@ -67,10 +69,18 @@ public class Fruit : MonoBehaviour
...
@@ -67,10 +69,18 @@ public class Fruit : MonoBehaviour
//生成爆炸效果
//生成爆炸效果
Instantiate
(
Resources
.
Load
<
GameObject
>(
"Prefabs/BoomEffect"
),
MidPos
,
Quaternion
.
identity
);
Instantiate
(
Resources
.
Load
<
GameObject
>(
"Prefabs/BoomEffect"
),
MidPos
,
Quaternion
.
identity
);
//生成音符特效
GameObject
obj
=
ResMgr
.
Getinstance
().
Load
<
GameObject
>(
"Prefabs/Note"
);
obj
.
transform
.
ResetToCanvas
(
E_Layer
.
system
,
UIMgr
.
Getinstance
().
canvas
.
InverseTransformPoint
(
MidPos
));
obj
.
GetComponent
<
Image
>().
sprite
=
ResMgr
.
Getinstance
().
Load
<
SpriteAtlas
>(
"Atlas/Notes"
).
GetSprite
(
"note"
+
UnityEngine
.
Random
.
Range
(
1
,
4
).
ToString
());
(
obj
.
transform
as
RectTransform
).
DoMove
(
0.5f
,
new
Vector2
(
0
,
580
),
trans
=>
{
Destroy
(
trans
.
gameObject
);
});
//发送事件
EventCenter
.
Getinstance
().
EventTrigger
(
"FlyNote"
);
Destroy
(
collision
.
gameObject
);
Destroy
(
collision
.
gameObject
);
Destroy
(
this
.
gameObject
);
Destroy
(
this
.
gameObject
);
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment