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
62f7b293
Commit
62f7b293
authored
Aug 20, 2023
by
Ever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新代码
parent
f9d29f48
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
44 deletions
+115
-44
gameScene.unity
Assets/Scenes/gameScene.unity
+4
-4
LoadingPanel.cs
Assets/scripts/Panel/LoadingPanel.cs
+6
-2
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+1
-1
GroupListManager.cs
Assets/scripts/Views/maingame/GroupListManager.cs
+80
-15
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+24
-22
No files found.
Assets/Scenes/gameScene.unity
View file @
62f7b293
...
@@ -1416,7 +1416,7 @@ RectTransform:
...
@@ -1416,7 +1416,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
1
}
m_AnchorMin
:
{
x
:
0
,
y
:
1
}
m_AnchorMax
:
{
x
:
0
,
y
:
1
}
m_AnchorMax
:
{
x
:
0
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
427
,
y
:
-82.5
00015
}
m_AnchoredPosition
:
{
x
:
427
,
y
:
-82.5
}
m_SizeDelta
:
{
x
:
87
,
y
:
91
}
m_SizeDelta
:
{
x
:
87
,
y
:
91
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&824212554
---
!u!114
&824212554
...
@@ -4354,9 +4354,9 @@ MonoBehaviour:
...
@@ -4354,9 +4354,9 @@ MonoBehaviour:
m_HandleRect
:
{
fileID
:
5101221413184368358
}
m_HandleRect
:
{
fileID
:
5101221413184368358
}
m_Direction
:
0
m_Direction
:
0
m_MinValue
:
0
m_MinValue
:
0
m_MaxValue
:
1
00
m_MaxValue
:
1
m_WholeNumbers
:
0
m_WholeNumbers
:
0
m_Value
:
1
00
m_Value
:
1
m_OnValueChanged
:
m_OnValueChanged
:
m_PersistentCalls
:
m_PersistentCalls
:
m_Calls
:
[]
m_Calls
:
[]
...
@@ -6408,7 +6408,7 @@ MonoBehaviour:
...
@@ -6408,7 +6408,7 @@ MonoBehaviour:
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
3396359898559686475
}
m_GameObject
:
{
fileID
:
3396359898559686475
}
m_Enabled
:
1
m_Enabled
:
0
m_EditorHideFlags
:
0
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
582a8965e0faeec4a8df7d0271769c6d
,
type
:
3
}
m_Script
:
{
fileID
:
11500000
,
guid
:
582a8965e0faeec4a8df7d0271769c6d
,
type
:
3
}
m_Name
:
m_Name
:
...
...
Assets/scripts/Panel/LoadingPanel.cs
View file @
62f7b293
...
@@ -25,15 +25,19 @@ public class LoadingPanel : MonoBehaviour
...
@@ -25,15 +25,19 @@ public class LoadingPanel : MonoBehaviour
}
}
private
void
ClosePanel
(
object
[]
values
)
private
void
ClosePanel
(
object
[]
values
)
{
if
(
gameObject
.
activeSelf
)
{
{
JIndu
.
value
=
1
;
JIndu
.
value
=
1
;
StartCoroutine
(
DelayClose
());
StartCoroutine
(
DelayClose
());
}
}
}
IEnumerator
DelayClose
()
IEnumerator
DelayClose
()
{
{
yield
return
new
WaitForSeconds
(
0.2f
);
yield
return
new
WaitForSeconds
(
0.2f
);
gameObject
.
SetActive
(
false
);
gameObject
.
SetActive
(
false
);
JIndu
.
value
=
0
;
}
}
float
jindu
=
0
;
float
jindu
=
0
;
private
void
ChangeSlider
(
object
[]
values
)
private
void
ChangeSlider
(
object
[]
values
)
...
...
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
62f7b293
...
@@ -90,7 +90,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
...
@@ -90,7 +90,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
transform
.
Find
(
"gameEndOperBase"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"gameEndOperBase"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"gameEndOperBase"
).
GetComponent
<
gameEndLogic
>().
initMember
();
transform
.
Find
(
"gameEndOperBase"
).
GetComponent
<
gameEndLogic
>().
initMember
();
transform
.
Find
(
"areaGroupList/tipSelectGroup"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"areaGroupList/tipSelectGroup"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"top"
).
gameObject
.
SetActive
(
false
);
//
transform.Find("top").gameObject.SetActive(false);
utilsTools
.
setGDataByKey
(
EventName
.
DataName
.
Data_PhoneOffsetValue
,
50
);
utilsTools
.
setGDataByKey
(
EventName
.
DataName
.
Data_PhoneOffsetValue
,
50
);
utilsTools
.
addTimer_Sec
(
gameObject
,
"loopGetHot"
,
(
String
name
)
=>
utilsTools
.
addTimer_Sec
(
gameObject
,
"loopGetHot"
,
(
String
name
)
=>
{
{
...
...
Assets/scripts/Views/maingame/GroupListManager.cs
View file @
62f7b293
...
@@ -7,6 +7,7 @@ using UnityEngine.UI;
...
@@ -7,6 +7,7 @@ using UnityEngine.UI;
using
System.Linq
;
using
System.Linq
;
using
DG.Tweening
;
using
DG.Tweening
;
using
TMPro
;
using
TMPro
;
using
static
UnityEditor
.
Progress
;
public
class
GroupListManager
:
MonoBehaviour
public
class
GroupListManager
:
MonoBehaviour
{
{
...
@@ -50,39 +51,91 @@ public class GroupListManager : MonoBehaviour
...
@@ -50,39 +51,91 @@ public class GroupListManager : MonoBehaviour
private
void
GroupItemChange
(
object
[]
values
)
private
void
GroupItemChange
(
object
[]
values
)
{
{
RoomGroupsData
data
=
(
RoomGroupsData
)
values
[
0
];
RoomGroupsData
data
=
(
RoomGroupsData
)
values
[
0
];
float
Jindu
=
0.4f
;
float
Jindu
=
(
float
)
data
.
roomIdsOver
.
Count
/((
float
)
data
.
roomIds
.
Count
+
(
float
)
data
.
roomIdsOver
.
Count
)
;
var
item
=
AllItem
.
FirstOrDefault
((
a
)
=>
{
return
a
.
GID
==
data
.
id
;
});
var
item
=
AllItem
.
FirstOrDefault
((
a
)
=>
{
return
a
.
GID
==
data
.
id
;
});
if
(
item
!=
null
)
if
(
item
!=
null
)
{
{
item
.
ChangeProgress
(
Jindu
);
item
.
ChangeProgress
(
Jindu
);
if
(
Jindu
>=
1
)
{
RemoveAGroup
(
item
);
}
}
}
}
private
void
RemoveAGroup
(
colorItem
item
)
{
AllItem
.
Remove
(
item
);
item
.
transform
.
DOScale
(
Vector3
.
zero
,
0.3f
).
onComplete
=
()
=>
{
item
.
gameObject
.
SetActive
(
false
);
};
//var nowselect= AllItem.FirstOrDefault(()=>)
for
(
int
i
=
0
;
i
<
AllItem
.
Count
;
i
++)
{
var
ite
=
AllItem
[
i
];
if
(
ite
.
index
>
item
.
index
)
{
ite
.
index
--;
ite
.
transform
.
DOLocalMoveX
(
ite
.
transform
.
localPosition
.
x
-
item
.
transform
.
GetComponent
<
RectTransform
>().
rect
.
x
,
0.3f
);
}
}
}
}
private
void
CreateGroup
(
object
[]
values
)
private
void
CreateGroup
(
object
[]
values
)
{
{
List
<
RoomGroupsData
>
roomGroupsData
=
(
List
<
RoomGroupsData
>)
values
[
0
];
List
<
RoomGroupsData
>
roomGroupsData
=
(
List
<
RoomGroupsData
>)
values
[
0
];
int
AllGroupNum
=
roomGroupsData
.
Count
;
//总的组个数
int
AllGroupNum
=
roomGroupsData
.
Count
;
//总的组个数
float
NowJindu
=
0
.4
f
;
//现在的进度
float
NowJindu
=
0f
;
//现在的进度
Transform
tran
;
Transform
tran
;
int
index
=
0
;
int
index
=
0
;
int
childCount
=
Content
.
transform
.
childCount
;
AllItem
.
Clear
();
for
(
int
i
=
0
;
i
<
childCount
;
i
++)
{
Content
.
transform
.
GetChild
(
i
).
gameObject
.
SetActive
(
false
);
}
if
(
childCount
>=
AllGroupNum
)
{
foreach
(
var
item
in
roomGroupsData
)
foreach
(
var
item
in
roomGroupsData
)
{
{
tran
=
GameObject
.
Instantiate
(
GroupItem_Obj
).
transform
;
tran
=
Content
.
transform
.
GetChild
(
index
);
tran
.
SetParent
(
Content
.
transform
);
NowJindu
=
(
float
)
item
.
roomIdsOver
.
Count
/
(
item
.
roomIds
.
Count
+
item
.
roomIdsOver
.
Count
);
tran
.
localPosition
=
Vector3
.
zero
;
var
coloritem
=
InitItem
(
tran
,
new
Color
(
item
.
R
,
item
.
G
,
item
.
B
)
/
255f
,
NowJindu
,
item
.
id
);
tran
.
localRotation
=
Quaternion
.
Euler
(
0
,
0
,
0
);
coloritem
.
index
=
index
;
tran
.
localScale
=
Vector3
.
one
;
index
++;
AllItem
.
Add
(
coloritem
);
//NowJindu = (float)item.roomIdsOver.Count / item.roomIds.Count + item.roomIdsOver.Count;
}
var
coloritem
=
tran
.
GetComponent
<
colorItem
>();
}
coloritem
.
Init
(
new
Color
(
item
.
R
,
item
.
G
,
item
.
B
)/
255f
,
NowJindu
,
item
.
id
);
else
{
for
(
int
i
=
0
;
i
<
childCount
;
i
++)
{
tran
=
Content
.
transform
.
GetChild
(
index
);
var
item
=
roomGroupsData
[
index
];
NowJindu
=
(
float
)
item
.
roomIdsOver
.
Count
/
(
item
.
roomIds
.
Count
+
item
.
roomIdsOver
.
Count
);
var
coloritem
=
InitItem
(
tran
,
new
Color
(
item
.
R
,
item
.
G
,
item
.
B
)
/
255f
,
NowJindu
,
item
.
id
);
coloritem
.
index
=
index
;
coloritem
.
index
=
index
;
index
++;
index
++;
AllItem
.
Add
(
coloritem
);
AllItem
.
Add
(
coloritem
);
}
}
AllGroupNum
=
roomGroupsData
.
Count
-
AllItem
.
Count
;
for
(
int
i
=
0
;
i
<
AllGroupNum
;
i
++)
{
var
item
=
roomGroupsData
[
index
];
tran
=
GameObject
.
Instantiate
(
GroupItem_Obj
).
transform
;
NowJindu
=
(
float
)
item
.
roomIdsOver
.
Count
/
(
item
.
roomIds
.
Count
+
item
.
roomIdsOver
.
Count
);
var
coloritem
=
InitItem
(
tran
,
new
Color
(
item
.
R
,
item
.
G
,
item
.
B
)
/
255f
,
NowJindu
,
item
.
id
);
coloritem
.
index
=
index
;
index
++;
AllItem
.
Add
(
coloritem
);
}
}
EventDispatcher
.
Dispatch
(
EventName
.
Event
.
Event_LoadingPanelCLose
);
EventDispatcher
.
Dispatch
(
EventName
.
Event
.
Event_LoadingPanelCLose
);
StartCoroutine
(
Delay
());
StartCoroutine
(
Delay
());
...
@@ -97,6 +150,18 @@ public class GroupListManager : MonoBehaviour
...
@@ -97,6 +150,18 @@ public class GroupListManager : MonoBehaviour
item
.
PlayInitAni
();
item
.
PlayInitAni
();
}
}
}
}
private
colorItem
InitItem
(
Transform
tran
,
Color
color
,
float
Jindu
,
int
gid
)
{
tran
.
SetParent
(
Content
.
transform
);
tran
.
localPosition
=
Vector3
.
zero
;
tran
.
localRotation
=
Quaternion
.
Euler
(
0
,
0
,
0
);
tran
.
localScale
=
Vector3
.
one
;
tran
.
gameObject
.
SetActive
(
true
);
var
coloritem
=
tran
.
GetComponent
<
colorItem
>();
coloritem
.
Init
(
color
,
Jindu
,
gid
);
return
coloritem
;
}
private
int
nowidx
=
0
;
private
int
nowidx
=
0
;
private
int
oldindex
=
0
;
private
int
oldindex
=
0
;
...
...
Assets/scripts/perfabItems/colorItem.cs
View file @
62f7b293
...
@@ -13,7 +13,7 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
...
@@ -13,7 +13,7 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
[
SerializeField
]
[
SerializeField
]
private
bool
isSelect
=
false
;
private
bool
isSelect
=
false
;
[
SerializeField
]
[
SerializeField
]
private
float
now
Progress
=
0
;
private
float
target
Progress
=
0
;
[
SerializeField
]
[
SerializeField
]
private
string
idName
=
""
;
private
string
idName
=
""
;
[
SerializeField
]
[
SerializeField
]
...
@@ -76,10 +76,13 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
...
@@ -76,10 +76,13 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
{
CreateMat
();
CreateMat
();
}
}
nowvalue
=
Jindu
;
NowProgress
=
Jindu
;
NowProgress
=
Jindu
;
UseColor
=
color
;
UseColor
=
color
;
GID
=
groupid
;
GID
=
groupid
;
IdName
=
groupid
.
ToString
();
IdName
=
groupid
.
ToString
();
Image_Jindu
.
material
.
SetFloat
(
"progress"
,
Jindu
);
}
}
public
void
ChangeProgress
(
float
jindu
)
public
void
ChangeProgress
(
float
jindu
)
...
@@ -109,29 +112,32 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
...
@@ -109,29 +112,32 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
}
}
public
float
NowProgress
public
float
NowProgress
{
{
set
{
set
if
(
value
<=
0
)
value
=
0f
;
else
if
(
value
>=
0.99999998
)
value
=
1.0f
;
if
(
utilsTools
.
isEqualByValue
(
value
,
1
,
0.000001f
))
{
{
value
=
1.0f
;
targetProgress
=
value
;
}
//Image_Jindu.material.SetFloat("progress", targetProgress);
nowProgress
=
value
;
bool
isend
=
this
.
isFinish
();
//effectImg.Height = 1.0f - nowProgress;
//effectImg.Height = nowProgress;
Image_Jindu
.
material
.
SetFloat
(
"progress"
,
nowProgress
);
transform
.
Find
(
"idname"
).
gameObject
.
SetActive
(!
isend
);
}
}
get
get
{
{
return
now
Progress
;
return
target
Progress
;
}
}
}
}
private
float
nowvalue
;
private
void
Update
()
{
if
(
targetProgress
>
nowvalue
)
{
nowvalue
+=
Time
.
deltaTime
/
2f
;
if
(
targetProgress
<=
nowvalue
)
{
nowvalue
=
targetProgress
;
}
Image_Jindu
.
material
.
SetFloat
(
"progress"
,
nowvalue
);
}
}
public
string
IdName
public
string
IdName
{
{
set
{
set
{
...
@@ -194,10 +200,6 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
...
@@ -194,10 +200,6 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
transform
.
localScale
=
Vector3
.
one
*
NotSelectScale
;
transform
.
localScale
=
Vector3
.
one
*
NotSelectScale
;
}
}
public
bool
isFinish
()
{
return
utilsTools
.
isEqualByValue
(
nowProgress
,
1.0f
,
0.0000002f
);
}
public
void
onClickAreaGroup
()
public
void
onClickAreaGroup
()
{
{
if
(
IsSelect
)
if
(
IsSelect
)
...
...
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