Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
T
tuseGameColor
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
shujianhe
tuseGameColor
Commits
4004cfd6
Commit
4004cfd6
authored
Aug 21, 2023
by
lijin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
点击特效
parent
e13926b5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
5220 additions
and
5 deletions
+5220
-5
EffectItem.cs
Assets/GameMgr/EffectItem.cs
+33
-0
EffectItem.cs.meta
Assets/GameMgr/EffectItem.cs.meta
+11
-0
EffectItem.mat
Assets/GameMgr/EffectItem.mat
+115
-0
EffectItem.mat.meta
Assets/GameMgr/EffectItem.mat.meta
+8
-0
EffectItemMgr.cs
Assets/GameMgr/EffectItemMgr.cs
+36
-0
EffectItemMgr.cs.meta
Assets/GameMgr/EffectItemMgr.cs.meta
+11
-0
GameMgr.cs
Assets/GameMgr/GameMgr.cs
+1
-0
MainData.cs
Assets/GameMgr/MainData.cs
+7
-4
GameMgr.prefab
Assets/Resources/perfabs/GameMgr.prefab
+4998
-1
No files found.
Assets/GameMgr/EffectItem.cs
0 → 100644
View file @
4004cfd6
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
EffectItem
:
MonoBehaviour
{
public
float
life
=
0
;
public
RectTransform
Rect
;
public
void
Init
(
Color
c
,
Vector3
v
)
{
MainData
md
=
GameMgr
.
Ins
.
md
;
Transform
p
=
Rect
.
parent
;
Rect
.
SetParent
(
md
.
imgpng
.
transform
);
Rect
.
localPosition
=
v
-
new
Vector3
(
md
.
png
.
width
/
2
,
md
.
png
.
height
/
2
);
Rect
.
SetParent
(
p
);
gameObject
.
SetActive
(
true
);
}
// Update is called once per frame
void
Update
()
{
if
(
life
>
0
)
{
life
-=
Time
.
deltaTime
;
if
(
life
<=
0
)
{
life
=
0
;
gameObject
.
SetActive
(
false
);
GameMgr
.
Ins
.
eiMgr
.
Circle
(
this
);
}
}
}
}
Assets/GameMgr/EffectItem.cs.meta
0 → 100644
View file @
4004cfd6
fileFormatVersion: 2
guid: e2c276431f99e6a42bbf529143c74d65
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/GameMgr/EffectItem.mat
0 → 100644
View file @
4004cfd6
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!21
&2100000
Material
:
serializedVersion
:
8
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
EffectItem
m_Shader
:
{
fileID
:
51
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_Parent
:
{
fileID
:
0
}
m_ModifiedSerializedProperties
:
0
m_ValidKeywords
:
[]
m_InvalidKeywords
:
-
_ALPHATEST_ON
m_LightmapFlags
:
4
m_EnableInstancingVariants
:
0
m_DoubleSidedGI
:
0
m_CustomRenderQueue
:
-1
stringTagMap
:
{}
disabledShaderPasses
:
[]
m_LockedProperties
:
m_SavedProperties
:
serializedVersion
:
3
m_TexEnvs
:
-
_AlphaTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_BumpMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailAlbedoMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailMask
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailNormalMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_EmissionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MainTex
:
m_Texture
:
{
fileID
:
2800000
,
guid
:
f4bb85eb67ae1b047adf11cdb81c8f3c
,
type
:
3
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MaskTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MetallicGlossMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_NormalMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_OcclusionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_ParallaxMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_SpecGlossMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
m_Ints
:
[]
m_Floats
:
-
PixelSnap
:
0
-
_BumpScale
:
1
-
_ColorMask
:
15
-
_Cutoff
:
0.5
-
_DetailNormalMapScale
:
1
-
_DstBlend
:
0
-
_EnableExternalAlpha
:
0
-
_GlossMapScale
:
1
-
_Glossiness
:
0.5
-
_GlossyReflections
:
1
-
_Inside
:
0
-
_Metallic
:
0
-
_Mode
:
1
-
_OcclusionStrength
:
1
-
_Parallax
:
0.02
-
_R
:
1
-
_SmoothnessTextureChannel
:
0
-
_SpecularHighlights
:
1
-
_SrcBlend
:
1
-
_Stencil
:
0
-
_StencilComp
:
8
-
_StencilOp
:
0
-
_StencilReadMask
:
255
-
_StencilWriteMask
:
255
-
_UVSec
:
0
-
_UseUIAlphaClip
:
0
-
_ZWrite
:
1
-
_sR
:
0.5
m_Colors
:
-
_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
-
_Flip
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_RendererColor
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_SpecColor
:
{
r
:
0.19999996
,
g
:
0.19999996
,
b
:
0.19999996
,
a
:
1
}
m_BuildTextureStacks
:
[]
Assets/GameMgr/EffectItem.mat.meta
0 → 100644
View file @
4004cfd6
fileFormatVersion: 2
guid: 159ffb2a2f9e3134a83b58d3b2073cfb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
Assets/GameMgr/EffectItemMgr.cs
0 → 100644
View file @
4004cfd6
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Linq
;
using
UnityEngine
;
public
class
EffectItemMgr
:
MonoBehaviour
{
public
List
<
EffectItem
>
useList
=
new
List
<
EffectItem
>();
public
List
<
EffectItem
>
poolList
=
new
List
<
EffectItem
>();
public
EffectItem
item
;
public
EffectItem
Get
()
{
if
(
poolList
.
Count
==
0
)
{
EffectItem
temp
=
Instantiate
<
EffectItem
>(
item
,
item
.
transform
.
parent
);
poolList
.
Add
(
temp
);
}
EffectItem
ret
=
poolList
[
0
];
poolList
.
RemoveAt
(
0
);
useList
.
Add
(
ret
);
return
ret
;
}
public
void
Circle
(
EffectItem
temp
)
{
if
(
useList
.
Contains
(
temp
))
{
useList
.
Remove
(
temp
);
poolList
.
Add
(
temp
);
temp
.
gameObject
.
SetActive
(
false
);
}
}
public
void
Create
(
Color
c
,
Vector3
v
)
{
Get
().
Init
(
c
,
v
);
}
}
Assets/GameMgr/EffectItemMgr.cs.meta
0 → 100644
View file @
4004cfd6
fileFormatVersion: 2
guid: e068ed22c2598024a8ae3e4666f7f5fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/GameMgr/GameMgr.cs
View file @
4004cfd6
...
@@ -15,6 +15,7 @@ public class GameMgr : MonoBehaviour
...
@@ -15,6 +15,7 @@ public class GameMgr : MonoBehaviour
public
MainData
md
;
public
MainData
md
;
public
MaskItemMgr
miMgr
;
public
MaskItemMgr
miMgr
;
public
TextItemMgr
tiMgr
;
public
TextItemMgr
tiMgr
;
public
EffectItemMgr
eiMgr
;
public
Texture2D
gray
;
public
Texture2D
gray
;
public
void
Init
(
string
key
,
Texture2D
png
,
Sprite
jpg
,
ResJsonData
json
)
public
void
Init
(
string
key
,
Texture2D
png
,
Sprite
jpg
,
ResJsonData
json
)
...
...
Assets/GameMgr/MainData.cs
View file @
4004cfd6
...
@@ -4,6 +4,7 @@ using System.Collections.Generic;
...
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Runtime.Serialization.Formatters.Binary
;
using
System.Runtime.Serialization.Formatters.Binary
;
using
Unity.VisualScripting
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.EventSystems
;
using
UnityEngine.EventSystems
;
using
UnityEngine.UI
;
using
UnityEngine.UI
;
...
@@ -80,13 +81,14 @@ public class MainData : MonoBehaviour
...
@@ -80,13 +81,14 @@ public class MainData : MonoBehaviour
{
{
for
(
int
i
=
0
;
i
<
json
.
roomGroupsData
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
json
.
roomGroupsData
.
Count
;
i
++)
{
{
if
(
json
.
roomGroupsData
[
i
].
roomIds
.
Contains
(
id
))
RoomGroupsData
rgd
=
json
.
roomGroupsData
[
i
];
if
(
rgd
.
roomIds
.
Contains
(
id
))
{
{
if
(
json
.
roomGroupsData
[
i
]
.
id
==
curGroupId
||
b
)
if
(
rgd
.
id
==
curGroupId
||
b
)
{
{
ExRoomDatas
erd
=
new
ExRoomDatas
();
ExRoomDatas
erd
=
new
ExRoomDatas
();
json
.
roomGroupsData
[
i
]
.
roomIds
.
Remove
(
id
);
rgd
.
roomIds
.
Remove
(
id
);
json
.
roomGroupsData
[
i
]
.
roomIdsOver
.
Add
(
id
);
rgd
.
roomIdsOver
.
Add
(
id
);
json
.
step
.
Add
(
id
);
json
.
step
.
Add
(
id
);
Color
[]
c_png
=
png
.
GetPixels
();
Color
[]
c_png
=
png
.
GetPixels
();
for
(
int
j
=
0
;
j
<
json
.
allPos
.
Count
;
j
++)
for
(
int
j
=
0
;
j
<
json
.
allPos
.
Count
;
j
++)
...
@@ -99,6 +101,7 @@ public class MainData : MonoBehaviour
...
@@ -99,6 +101,7 @@ public class MainData : MonoBehaviour
}
}
png
.
SetPixels
(
c_png
);
png
.
SetPixels
(
c_png
);
png
.
Apply
();
png
.
Apply
();
GameMgr
.
Ins
.
eiMgr
.
Create
(
new
Color
(
rgd
.
R
/
255f
,
rgd
.
G
/
255f
,
rgd
.
B
/
255f
,
1
),
v
);
GameMgr
.
Ins
.
tiMgr
.
CircleId
(
id
);
GameMgr
.
Ins
.
tiMgr
.
CircleId
(
id
);
GameMgr
.
Ins
.
miMgr
.
Play
(
v
,
id
);
GameMgr
.
Ins
.
miMgr
.
Play
(
v
,
id
);
EventDispatcher
.
Dispatch
(
EventName
.
Event
.
Event_GropuItemChange
,
json
.
roomGroupsData
[
i
]);
EventDispatcher
.
Dispatch
(
EventName
.
Event
.
Event_GropuItemChange
,
json
.
roomGroupsData
[
i
]);
...
...
Assets/Resources/perfabs/GameMgr.prefab
View file @
4004cfd6
This diff is collapsed.
Click to expand it.
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