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
2da04a6e
Commit
2da04a6e
authored
Aug 19, 2023
by
Ever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新代码
parent
0faf3ff1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
10 deletions
+55
-10
GameMgr.cs
Assets/GameMgr/GameMgr.cs
+4
-1
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+2
-2
GroupListManager.cs
Assets/scripts/Views/maingame/GroupListManager.cs
+39
-2
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+10
-5
No files found.
Assets/GameMgr/GameMgr.cs
View file @
2da04a6e
...
...
@@ -22,5 +22,8 @@ public class GameMgr : MonoBehaviour
md
.
Init
(
_png
,
_jpg
,
_json
);
}
public
void
ChooseGroup
(
int
id
)
{
}
}
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
2da04a6e
...
...
@@ -84,8 +84,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
onEvent
(
EventName
.
Event
.
Event_GroupIsLoadOver
,
onGroupIsLoadOver
);
//组的成员加载完成,就是组列表下的item
transform
.
Find
(
"ingameLoad/loadImg"
).
gameObject
.
SetActive
(
false
);
//gameScenUser
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
gridViewList
.
gameObject
.
SetActive
(
false
);
//
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
//
gridViewList.gameObject.SetActive(false);
transform
.
Find
(
"areaGroupList/groupListBg"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"areaGroupList/gameProgress/gameProgressText"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"areaGroupList/gameProgress"
).
gameObject
.
SetActive
(
false
);
...
...
Assets/scripts/Views/maingame/GroupListManager.cs
View file @
2da04a6e
...
...
@@ -8,12 +8,18 @@ using System.Linq;
public
class
GroupListManager
:
MonoBehaviour
{
private
static
GroupListManager
instance
;
public
static
GroupListManager
Instance
=>
instance
;
public
ScrollRect
scrollview
;
//列表
public
GameObject
GroupItem_Obj
;
//要实例化的预制体
public
GridLayoutGroup
Content
;
private
List
<
colorItem
>
AllItem
=
new
List
<
colorItem
>();
private
void
Awake
()
{
instance
=
this
;
}
// Start is called before the first frame update
void
Start
()
{
...
...
@@ -44,6 +50,7 @@ public class GroupListManager : MonoBehaviour
int
AllGroupNum
=
roomGroupsData
.
Count
;
//总的组个数
float
NowJindu
=
0.4f
;
//现在的进度
Transform
tran
;
int
index
=
0
;
foreach
(
var
item
in
roomGroupsData
)
{
...
...
@@ -53,12 +60,42 @@ public class GroupListManager : MonoBehaviour
tran
.
localRotation
=
Quaternion
.
Euler
(
0
,
0
,
0
);
tran
.
localScale
=
Vector3
.
one
;
NowJindu
=(
float
)
item
.
curCount
/
item
.
roomIds
.
Count
;
var
coloritem
=
tran
.
GetComponent
<
colorItem
>();
coloritem
.
Init
(
new
Color
(
item
.
R
,
item
.
G
,
item
.
B
),
NowJindu
,
item
.
id
);
coloritem
.
Init
(
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
);
StartCoroutine
(
Delay
());
}
IEnumerator
Delay
()
{
yield
return
new
WaitForSeconds
(
0.1f
);
foreach
(
var
item
in
AllItem
)
{
item
.
SetLocalRootPos
();
item
.
PlayInitAni
();
}
}
public
void
ClickItem
(
int
Gid
,
int
clickindex
)
{
foreach
(
var
item
in
AllItem
)
{
item
.
IsSelect
=
item
.
GID
==
Gid
;
if
(
item
.
GID
==
Gid
)
continue
;
item
.
ChangeLocalPos_Select
(
item
.
index
<
clickindex
,
clickindex
,
item
.
transform
.
localPosition
.
x
);
item
.
switchPlayAnimation
();
}
}
}
Assets/scripts/perfabItems/colorItem.cs
View file @
2da04a6e
...
...
@@ -80,6 +80,7 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
NowProgress
=
Jindu
;
UseColor
=
color
;
GID
=
groupid
;
IdName
=
groupid
.
ToString
();
}
public
void
ChangeProgress
(
float
jindu
)
...
...
@@ -243,11 +244,15 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
return
;
}
//if (isSelect == false && isFinish() == false)
{
if
(
utilsTools
.
getGDataByKey
<
bool
>(
EventName
.
DataName
.
Data_autoFillColor
,
false
))
return
;
utilsTools
.
sendEventObjectParams
(
EventName
.
Event
.
Event_switchGameAreaGroupId
,
index
);
}
////if (isSelect == false && isFinish() == false)
//{
// if (utilsTools.getGDataByKey<bool>(EventName.DataName.Data_autoFillColor, false)) return;
// utilsTools.sendEventObjectParams(EventName.Event.Event_switchGameAreaGroupId, index);
//}
GameMgr
.
Ins
.
ChooseGroup
(
GID
);
GroupListManager
.
Instance
.
ClickItem
(
GID
,
index
);
}
public
void
SetLocalRootPos
()
//保存一下第一个的原始坐标
...
...
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