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
16669b22
Commit
16669b22
authored
Aug 21, 2023
by
Ever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除灰圖僅使用mask
parent
42e43354
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
8 deletions
+38
-8
MainData.cs
Assets/GameMgr/MainData.cs
+2
-2
MaskItem.cs
Assets/GameMgr/MaskItem.cs
+21
-3
MaskItemMgr.cs
Assets/GameMgr/MaskItemMgr.cs
+15
-3
No files found.
Assets/GameMgr/MainData.cs
View file @
16669b22
...
...
@@ -102,7 +102,7 @@ public class MainData : MonoBehaviour
GameMgr
.
Ins
.
giMgr
.
CircleId
(
id
);
GameMgr
.
Ins
.
tiMgr
.
CircleId
(
id
);
GameMgr
.
Ins
.
miMgr
.
Create
(
this
,
erd
,
v
);
GameMgr
.
Ins
.
miMgr
.
Play
(
v
,
id
);
EventDispatcher
.
Dispatch
(
EventName
.
Event
.
Event_GropuItemChange
,
json
.
roomGroupsData
[
i
]);
SaveManager
.
Instance
.
SaveRes
(
key
,
json
,
png
);
return
true
;
...
...
@@ -150,7 +150,7 @@ public class MainData : MonoBehaviour
}
for
(
int
i
=
0
;
i
<
list
.
Count
;
i
++)
{
GameMgr
.
Ins
.
g
iMgr
.
Create
(
this
,
dic
[
list
[
i
]],
list
[
i
]);
GameMgr
.
Ins
.
m
iMgr
.
Create
(
this
,
dic
[
list
[
i
]],
list
[
i
]);
}
}
...
...
Assets/GameMgr/MaskItem.cs
View file @
16669b22
...
...
@@ -6,6 +6,7 @@ using UnityEngine.UI;
public
class
MaskItem
:
MonoBehaviour
{
public
int
id
=
-
1
;
public
float
IsUse
=
-
1
;
public
Image
SP
;
public
RectTransform
Rect
;
...
...
@@ -15,7 +16,7 @@ public class MaskItem : MonoBehaviour
// Update is called once per frame
void
Update
()
{
if
(
IsUse
==
-
1
)
if
(
IsUse
<
0
)
{
return
;
}
...
...
@@ -28,8 +29,10 @@ public class MaskItem : MonoBehaviour
}
}
public
void
FunDo
(
MainData
md
,
ExRoomDatas
erd
,
Vector3
v
)
public
void
FunDo
(
MainData
md
,
ExRoomDatas
erd
,
int
_id
)
{
Vector3
v
=
Vector3
.
zero
;
id
=
_id
;
//创建图片
Texture2D
te
=
new
Texture2D
((
int
)(
erd
.
size
.
z
-
erd
.
size
.
x
+
1
),
(
int
)(
erd
.
size
.
w
-
erd
.
size
.
y
+
1
),
TextureFormat
.
RGBA32
,
false
);
Color
[]
colors
=
te
.
GetPixels
();
...
...
@@ -69,6 +72,21 @@ public class MaskItem : MonoBehaviour
Rect
.
sizeDelta
=
Vector2
.
zero
;
float
a
=
Math
.
Max
(
erd
.
size
.
z
-
v
.
x
,
v
.
x
-
erd
.
size
.
x
);
float
b
=
Math
.
Max
(
erd
.
size
.
w
-
v
.
y
,
v
.
y
-
erd
.
size
.
y
);
IsUse
=
Math
.
Max
(
a
,
b
)
*
2
;
IsUse
=
-
Math
.
Max
(
a
,
b
)
*
2
;
}
internal
void
Play
(
Vector3
v
)
{
MainData
md
=
GameMgr
.
Ins
.
md
;
SPRect
.
SetParent
(
md
.
imgpng
.
transform
);
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
);
SPRect
.
SetParent
(
Rect
);
IsUse
*=
-
1
;
}
}
Assets/GameMgr/MaskItemMgr.cs
View file @
16669b22
using
DG.Tweening
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
...
...
@@ -27,9 +28,20 @@ public class MaskItemMgr : MonoBehaviour
poolList
.
Add
(
temp
);
}
}
public
void
Create
(
MainData
md
,
ExRoomDatas
erd
,
Vector3
v
)
public
void
Create
(
MainData
md
,
ExRoomDatas
erd
,
int
id
)
{
MaskItem
temp
=
Get
();
temp
.
FunDo
(
md
,
erd
,
v
);
temp
.
FunDo
(
md
,
erd
,
id
);
}
}
public
void
Play
(
Vector3
v
,
int
id
)
{
for
(
int
i
=
0
;
i
<
useList
.
Count
;
i
++)
{
if
(
useList
[
i
].
id
==
id
)
{
useList
[
i
].
Play
(
v
);
}
}
}
}
\ No newline at end of file
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