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
73f1d334
Commit
73f1d334
authored
Aug 21, 2023
by
JiangWanZhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新长按选中组的表现
parent
42e43354
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
23 deletions
+80
-23
MainData.cs
Assets/GameMgr/MainData.cs
+2
-0
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+2
-2
GroupListManager.cs
Assets/scripts/Views/maingame/GroupListManager.cs
+75
-19
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+1
-2
No files found.
Assets/GameMgr/MainData.cs
View file @
73f1d334
...
@@ -124,6 +124,7 @@ public class MainData : MonoBehaviour
...
@@ -124,6 +124,7 @@ public class MainData : MonoBehaviour
{
{
return
;
return
;
}
}
curGroupId
=
id
;
curGroupId
=
id
;
List
<
int
>
list
=
new
List
<
int
>();
List
<
int
>
list
=
new
List
<
int
>();
List
<
RoomGroupsData
>
l
=
json
.
roomGroupsData
;
List
<
RoomGroupsData
>
l
=
json
.
roomGroupsData
;
...
@@ -152,6 +153,7 @@ public class MainData : MonoBehaviour
...
@@ -152,6 +153,7 @@ public class MainData : MonoBehaviour
{
{
GameMgr
.
Ins
.
giMgr
.
Create
(
this
,
dic
[
list
[
i
]],
list
[
i
]);
GameMgr
.
Ins
.
giMgr
.
Create
(
this
,
dic
[
list
[
i
]],
list
[
i
]);
}
}
EventDispatcher
.
Dispatch
(
EventName
.
Event
.
Event_ChoiseGroupByPic
,
curGroupId
);
}
}
public
void
OnLongPressPos
(
Vector2
v
)
public
void
OnLongPressPos
(
Vector2
v
)
...
...
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
73f1d334
...
@@ -84,7 +84,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
...
@@ -84,7 +84,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
onEvent
(
EventName
.
Event
.
Event_GroupIsLoadOver
,
onGroupIsLoadOver
);
//组的成员加载完成,就是组列表下的item
onEvent
(
EventName
.
Event
.
Event_GroupIsLoadOver
,
onGroupIsLoadOver
);
//组的成员加载完成,就是组列表下的item
transform
.
Find
(
"ingameLoad/loadImg"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"ingameLoad/loadImg"
).
gameObject
.
SetActive
(
false
);
//gameScenUser
//gameScenUser
transform
.
Find
(
"areaGroupList/groupListBg"
).
gameObject
.
SetActive
(
false
);
//
transform.Find("areaGroupList/groupListBg").gameObject.SetActive(false);
transform
.
Find
(
"areaGroupList/gameProgress/gameProgressText"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"areaGroupList/gameProgress/gameProgressText"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"areaGroupList/gameProgress"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"areaGroupList/gameProgress"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"gameEndOperBase"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"gameEndOperBase"
).
gameObject
.
SetActive
(
false
);
...
@@ -314,7 +314,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
...
@@ -314,7 +314,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
return
;
return
;
}
}
areaGroupList
.
SetActive
(
true
);
areaGroupList
.
SetActive
(
true
);
transform
.
Find
(
"areaGroupList/groupListBg"
).
gameObject
.
SetActive
(
true
);
//
transform.Find("areaGroupList/groupListBg").gameObject.SetActive(true);
if
(
autoSwitchGroup
==
false
)
nowidx
=
-
1
;
if
(
autoSwitchGroup
==
false
)
nowidx
=
-
1
;
var
cellSize
=
gridViewList
.
getCellSize
();
var
cellSize
=
gridViewList
.
getCellSize
();
gradViewBack
gradView
=
(
GameObject
gobject
,
int
idx
,
ListViewBackTypeEnum
lvbType
)
=>
{
gradViewBack
gradView
=
(
GameObject
gobject
,
int
idx
,
ListViewBackTypeEnum
lvbType
)
=>
{
...
...
Assets/scripts/Views/maingame/GroupListManager.cs
View file @
73f1d334
...
@@ -45,24 +45,51 @@ public class GroupListManager : MonoBehaviour
...
@@ -45,24 +45,51 @@ public class GroupListManager : MonoBehaviour
EventDispatcher
.
RegisterEvent
(
EventName
.
Event
.
Event_ChoiseGroupByPic
,
Event_ChoiseGroupByPic
,
flag
);
EventDispatcher
.
RegisterEvent
(
EventName
.
Event
.
Event_ChoiseGroupByPic
,
Event_ChoiseGroupByPic
,
flag
);
}
}
public
int
idd
=
5
;
//private void Update()
private
void
Update
()
//{
{
// if (Input.GetKeyDown(KeyCode.A)) //后面还要用上的,先不删
if
(
Input
.
GetKeyDown
(
KeyCode
.
A
))
// {
{
// var item = AllItem[AllItem.Count - 1];
EventDispatcher
.
Dispatch
(
EventName
.
Event
.
Event_ChoiseGroupByPic
,
idd
);
// if (item != null)
}
// {
}
// RemoveAGroup(item);
// }
// }
// if (Input.GetKeyDown(KeyCode.S))
// {
// var item = AllItem[AllItem.Count - 2];
// if (item != null)
// {
// RemoveAGroup(item);
// }
// }
//}
private
void
Event_ChoiseGroupByPic
(
object
[]
values
)
//图片区域长按选择一个组
private
void
Event_ChoiseGroupByPic
(
object
[]
values
)
//图片区域长按选择一个组
{
{
int
Gid
=
(
int
)
values
[
0
];
int
Gid
=
(
int
)
values
[
0
];
var
item
=
AllItem
.
FirstOrDefault
((
a
)
=>
a
.
GID
==
Gid
);
var
item
=
AllItem
.
FirstOrDefault
((
a
)
=>
a
.
GID
==
Gid
);
float
childsize
=
item
.
GetComponent
<
RectTransform
>().
sizeDelta
.
x
;
if
(
item
!=
null
)
if
(
item
!=
null
)
{
{
float
targetpos
=
childsize
*
item
.
index
-
scrollview
.
flexibleWidth
;
float
childsize
=
item
.
GetComponent
<
RectTransform
>().
sizeDelta
.
x
;
//Content.transform.DOLocalMoveX();
float
targetpos
=
childsize
*
item
.
index
-
scrollview
.
transform
.
GetComponent
<
RectTransform
>().
sizeDelta
.
x
/
2f
+
childsize
/
2f
;
//让选中组在中间
if
(
targetpos
>
0
)
{
Content
.
transform
.
DOLocalMoveX
(-
targetpos
,
0.5f
);
}
else
{
Content
.
transform
.
DOLocalMoveX
(
0
,
0.5f
);
}
var
oldselect
=
AllItem
.
FirstOrDefault
((
a
)
=>
a
.
IsSelect
==
true
);
if
(
oldselect
!=
null
)
{
oldselect
.
IsSelect
=
false
;
oldselect
.
switchPlayAnimation
();
}
item
.
IsSelect
=
true
;
item
.
switchPlayAnimation
();
}
}
}
}
...
@@ -86,24 +113,52 @@ public class GroupListManager : MonoBehaviour
...
@@ -86,24 +113,52 @@ public class GroupListManager : MonoBehaviour
}
}
}
}
private
void
RemoveAGroup
(
colorItem
item
)
private
void
RemoveAGroup
(
colorItem
remove
item
)
{
{
AllItem
.
Remove
(
item
);
AllItem
.
Remove
(
remove
item
);
item
.
transform
.
DOScale
(
Vector3
.
zero
,
0.3f
).
onComplete
=
()
=>
remove
item
.
transform
.
DOScale
(
Vector3
.
zero
,
0.3f
).
onComplete
=
()
=>
{
{
item
.
gameObject
.
SetActive
(
false
);
remove
item
.
gameObject
.
SetActive
(
false
);
};
};
//var nowselect= AllItem.FirstOrDefault(()=>)
int
NextItemIndex
=
0
;
float
childsize
=
removeitem
.
transform
.
GetComponent
<
RectTransform
>().
sizeDelta
.
x
;
if
(
removeitem
.
index
<
AllItem
.
Count
)
{
NextItemIndex
=
removeitem
.
index
+
1
;
}
else
{
NextItemIndex
=
AllItem
.
Count
-
1
;
for
(
int
i
=
0
;
i
<
AllItem
.
Count
;
i
++)
{
var
ite
=
AllItem
[
i
];
ite
.
transform
.
DOLocalMoveX
(
ite
.
transform
.
localPosition
.
x
+
childsize
,
0.3f
);
if
(
ite
.
index
==
NextItemIndex
)
{
ite
.
IsSelect
=
true
;
ite
.
switchPlayAnimation
();
}
}
return
;
}
for
(
int
i
=
0
;
i
<
AllItem
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
AllItem
.
Count
;
i
++)
{
{
var
ite
=
AllItem
[
i
];
var
ite
=
AllItem
[
i
];
if
(
ite
.
index
>
item
.
index
)
if
(
ite
.
index
>
remove
item
.
index
)
{
{
ite
.
transform
.
DOLocalMoveX
(
ite
.
transform
.
localPosition
.
x
-
childsize
,
0.3f
);
if
(
ite
.
index
==
NextItemIndex
)
{
ite
.
IsSelect
=
true
;
ite
.
switchPlayAnimation
();
}
ite
.
index
--;
ite
.
index
--;
ite
.
transform
.
DOLocalMoveX
(
ite
.
transform
.
localPosition
.
x
-
item
.
transform
.
GetComponent
<
RectTransform
>().
rect
.
x
,
0.3f
);
}
}
}
}
}
}
...
@@ -166,8 +221,9 @@ public class GroupListManager : MonoBehaviour
...
@@ -166,8 +221,9 @@ public class GroupListManager : MonoBehaviour
IEnumerator
Delay
()
IEnumerator
Delay
()
{
{
for
each
(
var
item
in
AllItem
)
for
(
int
i
=
0
;
i
<
AllItem
.
Count
;
i
++
)
{
{
var
item
=
AllItem
[
i
];
yield
return
new
WaitForSeconds
(
0.05f
);
yield
return
new
WaitForSeconds
(
0.05f
);
item
.
SetLocalRootPos
();
item
.
SetLocalRootPos
();
item
.
PlayInitAni
();
item
.
PlayInitAni
();
...
...
Assets/scripts/perfabItems/colorItem.cs
View file @
73f1d334
...
@@ -99,14 +99,13 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
...
@@ -99,14 +99,13 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
{
transform
.
DOScale
(
Vector3
.
one
*
SelectAniScale
,
0.2f
).
SetEase
(
Ease
.
OutSine
).
onComplete
=
()
=>
transform
.
DOScale
(
Vector3
.
one
*
SelectAniScale
,
0.2f
).
SetEase
(
Ease
.
OutSine
).
onComplete
=
()
=>
{
{
CanPlayAniFlag
=
true
;
transform
.
DOScale
(
Vector3
.
one
*
SelectScale
,
0.1f
);
transform
.
DOScale
(
Vector3
.
one
*
SelectScale
,
0.1f
);
};
};
}
}
else
else
{
{
transform
.
DOScale
(
Vector3
.
one
*
NotSelectScale
,
0.2f
).
SetEase
(
Ease
.
OutSine
)
.
onComplete
=
()
=>
{
CanPlayAniFlag
=
false
;
}
;
transform
.
DOScale
(
Vector3
.
one
*
NotSelectScale
,
0.2f
).
SetEase
(
Ease
.
OutSine
);
}
}
}
}
...
...
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