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
d1dbc732
Commit
d1dbc732
authored
Aug 23, 2023
by
lijin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重播BUG
parent
0aa237e1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
28 deletions
+29
-28
GameMgr.cs
Assets/GameMgr/GameMgr.cs
+2
-1
MaskItem.cs
Assets/GameMgr/MaskItem.cs
+16
-15
MaskItemMgr.cs
Assets/GameMgr/MaskItemMgr.cs
+9
-9
GameMgr.prefab
Assets/Resources/perfabs/GameMgr.prefab
+2
-3
No files found.
Assets/GameMgr/GameMgr.cs
View file @
d1dbc732
...
...
@@ -55,6 +55,7 @@ public class GameMgr : MonoBehaviour
public
void
RePlay
()
{
md
.
RePlay
();
maxTime
=
2f
/
md
.
dynamic
.
step
.
Count
;
stepIndex
=
0
;
curTime
=
0
;
}
...
...
@@ -150,7 +151,7 @@ public class GameMgr : MonoBehaviour
#
region
涂色重播逻辑
private
int
stepIndex
=
-
1
;
//重播判断值,-1不处理,0及以上为重播到第几步
private
static
readonly
float
delay
=
0.5f
;
//重播延迟
private
static
readonly
float
maxTime
=
0.1f
;
//重播步间隔
private
static
float
maxTime
=
0.1f
;
//重播步间隔
private
float
curTime
=
0
;
//重播当前进行时间
//Update调用判断逻辑
private
void
Play
()
...
...
Assets/GameMgr/MaskItem.cs
View file @
d1dbc732
...
...
@@ -10,7 +10,7 @@ public class MaskItem : MonoBehaviour
public
int
groupId
=
-
1
;
public
float
IsUse
=
-
1
;
public
Image
SP
;
public
RectTransform
R
ect
;
public
RectTransform
r
ect
;
public
RectTransform
SPRect
;
public
Vector4
size
;
// Update is called once per frame
...
...
@@ -20,8 +20,8 @@ public class MaskItem : MonoBehaviour
{
return
;
}
R
ect
.
sizeDelta
+=
Time
.
deltaTime
*
Vector2
.
one
*
IsUse
*
3f
;
if
(
Rect
.
sizeDelta
.
x
>
IsUse
*
1.05f
&&
R
ect
.
sizeDelta
.
y
>
IsUse
*
1.5f
)
r
ect
.
sizeDelta
+=
Time
.
deltaTime
*
Vector2
.
one
*
IsUse
*
3f
;
if
(
rect
.
sizeDelta
.
x
>
IsUse
*
1.05f
&&
r
ect
.
sizeDelta
.
y
>
IsUse
*
1.5f
)
{
IsUse
=
-
1
;
Hide
();
...
...
@@ -55,19 +55,19 @@ public class MaskItem : MonoBehaviour
SP
.
GetComponent
<
RectTransform
>().
sizeDelta
=
new
Vector2
(
te
.
width
,
te
.
height
);
//坐标计算
Transform
p
=
R
ect
.
parent
;
R
ect
.
SetParent
(
md
.
imgpng
.
transform
);
R
ect
.
localPosition
=
Vector3
.
zero
;
R
ect
.
SetParent
(
p
);
R
ect
.
localScale
=
Vector2
.
one
;
Transform
p
=
r
ect
.
parent
;
r
ect
.
SetParent
(
md
.
imgpng
.
transform
);
r
ect
.
localPosition
=
Vector3
.
zero
;
r
ect
.
SetParent
(
p
);
r
ect
.
localScale
=
Vector2
.
one
;
SPRect
.
SetParent
(
md
.
imgpng
.
transform
);
SPRect
.
localPosition
=
new
Vector3
(
erd
.
size
.
x
+
(
erd
.
size
.
z
+
1
-
erd
.
size
.
x
)
/
2
-
(
md
.
json
.
width
+
1
)
/
2
,
erd
.
size
.
y
+
(
erd
.
size
.
w
+
1
-
erd
.
size
.
y
)
/
2
-
(
md
.
json
.
height
+
1
)
/
2
,
0
);
SPRect
.
SetParent
(
R
ect
);
SPRect
.
SetParent
(
r
ect
);
SPRect
.
localScale
=
Vector2
.
one
;
//初始处理
R
ect
.
sizeDelta
=
Vector2
.
zero
;
r
ect
.
sizeDelta
=
Vector2
.
zero
;
size
=
erd
.
size
;
}
...
...
@@ -83,6 +83,7 @@ public class MaskItem : MonoBehaviour
public
void
Show
()
{
IsUse
=
-
1
;
rect
.
sizeDelta
=
Vector2
.
zero
;
gameObject
.
SetActive
(
true
);
}
public
void
Hide
()
...
...
@@ -94,12 +95,12 @@ public class MaskItem : MonoBehaviour
MainData
md
=
GameMgr
.
Ins
.
md
;
SPRect
.
SetParent
(
md
.
imgpng
.
transform
);
Transform
p
=
R
ect
.
parent
;
R
ect
.
SetParent
(
md
.
imgpng
.
transform
);
R
ect
.
localPosition
=
v
-
new
Vector3
(
md
.
json
.
width
/
2
,
md
.
json
.
height
/
2
);
R
ect
.
SetParent
(
p
);
Transform
p
=
r
ect
.
parent
;
r
ect
.
SetParent
(
md
.
imgpng
.
transform
);
r
ect
.
localPosition
=
v
-
new
Vector3
(
md
.
json
.
width
/
2
,
md
.
json
.
height
/
2
);
r
ect
.
SetParent
(
p
);
SPRect
.
SetParent
(
R
ect
);
SPRect
.
SetParent
(
r
ect
);
float
a
=
Math
.
Max
(
size
.
z
-
v
.
x
,
v
.
x
-
size
.
x
);
float
b
=
Math
.
Max
(
size
.
w
-
v
.
y
,
v
.
y
-
size
.
y
);
...
...
Assets/GameMgr/MaskItemMgr.cs
View file @
d1dbc732
...
...
@@ -121,15 +121,15 @@ public class MaskItemMgr : MonoBehaviour
{
for
(
int
i
=
0
;
i
<
useList
.
Count
;
i
++)
{
if
(
GameMgr
.
Ins
.
md
.
dynamic
.
step
.
Contains
(
useList
[
i
].
roomId
))
{
useList
[
i
].
Show
()
;
useList
[
i
].
Rect
.
sizeDelta
=
Vector2
.
zero
;
}
else
{
useList
[
i
].
Hide
(
);
}
useList
[
i
].
Hide
();
}
List
<
int
>
l
=
GameMgr
.
Ins
.
md
.
dynamic
.
step
;
for
(
int
i
=
0
;
i
<
l
.
Count
;
i
++)
{
RoomDatas
rd
=
GameMgr
.
Ins
.
md
.
json
.
roomDatas
[
l
[
i
]];
RoomGroupsData
rgd
=
GameMgr
.
Ins
.
md
.
json
.
roomGroupsData
[
rd
.
groupId
];
MaskItem
item
=
IsHave
(
rgd
,
rd
);
item
.
Show
();
}
}
}
\ No newline at end of file
Assets/Resources/perfabs/GameMgr.prefab
View file @
d1dbc732
...
...
@@ -179,6 +179,7 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
roomId
:
-1
groupId
:
-1
Text
:
{
fileID
:
1434280649147581400
}
---
!u!114
&1434280649147581400
MonoBehaviour
:
...
...
@@ -5753,12 +5754,11 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
c99b850a1f8be4640b391afdbd751ee8
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
bigArea
:
0
roomId
:
-1
groupId
:
-1
IsUse
:
-1
SP
:
{
fileID
:
7114594662145661671
}
R
ect
:
{
fileID
:
3859749812772851665
}
r
ect
:
{
fileID
:
3859749812772851665
}
SPRect
:
{
fileID
:
4668905872759166448
}
size
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
0
}
---
!u!1
&5487798596680419126
...
...
@@ -5896,7 +5896,6 @@ MonoBehaviour:
tiMgr
:
{
fileID
:
1490190831900560014
}
eiMgr
:
{
fileID
:
3661810172065829162
}
gray
:
{
fileID
:
2800000
,
guid
:
cfe63fc6a2e3edc409d653cefd205fb7
,
type
:
3
}
saveTime
:
-1
---
!u!114
&977886392249047969
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
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