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
836c6b67
Commit
836c6b67
authored
Aug 19, 2023
by
Ever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新代码
parent
8ea81a43
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
95 additions
and
58 deletions
+95
-58
bar_base.png
Assets/Art/GameEnd/bar_base.png
+0
-0
bar_base.png.meta
Assets/Art/GameEnd/bar_base.png.meta
+0
-0
gameSelectGroupHuan.png
Assets/Art/GameEnd/gameSelectGroupHuan.png
+0
-0
gameSelectGroupHuan.png.meta
Assets/Art/GameEnd/gameSelectGroupHuan.png.meta
+0
-0
New Folder.meta
Assets/Art/New Folder.meta
+8
-0
UIWave.mat
Assets/Materials/UIWave.mat
+1
-1
Sprites.spriteatlasv2.meta
Assets/Resources/SpriteAtls/Sprites.spriteatlasv2.meta
+2
-2
gameScene.unity
Assets/Scenes/gameScene.unity
+4
-0
GroupListManager.cs
Assets/scripts/Views/maingame/GroupListManager.cs
+67
-4
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+13
-51
No files found.
Assets/
Resources
/bar_base.png
→
Assets/
Art/GameEnd
/bar_base.png
View file @
836c6b67
File moved
Assets/
Resources
/bar_base.png.meta
→
Assets/
Art/GameEnd
/bar_base.png.meta
View file @
836c6b67
File moved
Assets/
Resources/scenes/game
/gameSelectGroupHuan.png
→
Assets/
Art/GameEnd
/gameSelectGroupHuan.png
View file @
836c6b67
File moved
Assets/
Resources/scenes/game
/gameSelectGroupHuan.png.meta
→
Assets/
Art/GameEnd
/gameSelectGroupHuan.png.meta
View file @
836c6b67
File moved
Assets/Art/New Folder.meta
0 → 100644
View file @
836c6b67
fileFormatVersion: 2
guid: 3f8aca84e2bb76c45a1446863094cd08
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Materials/UIWave.mat
View file @
836c6b67
...
...
@@ -56,7 +56,7 @@ Material:
-
_EnableExternalAlpha
:
0
-
_QueueControl
:
1
-
_QueueOffset
:
0
-
progress
:
0.2
-
progress
:
0.
47
2
m_Colors
:
-
_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_Flip
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
...
...
Assets/Resources/SpriteAtls/Sprites.spriteatlasv2.meta
View file @
836c6b67
...
...
@@ -20,8 +20,8 @@ SpriteAtlasImporter:
blockOffset: 1
allowAlphaSplitting: 0
enableRotation: 1
enableTightPacking:
1
enableAlphaDilation:
0
enableTightPacking:
0
enableAlphaDilation:
1
secondaryTextureSettings: {}
variantMultiplier: 1
bindAsDefault: 1
...
...
Assets/Scenes/gameScene.unity
View file @
836c6b67
...
...
@@ -7727,6 +7727,10 @@ MonoBehaviour:
scrollview
:
{
fileID
:
9106039126864166766
}
GroupItem_Obj
:
{
fileID
:
7981298386664250482
,
guid
:
7d786f635d2d5e94d8dd97c6e2fb276c
,
type
:
3
}
Content
:
{
fileID
:
7626438656205820263
}
ListMoveOffSet
:
35
TipTitle
:
{
fileID
:
1539005795910344629
}
AllProcress
:
{
fileID
:
1667660345673518993
}
AllProcress_Text
:
{
fileID
:
4457589912443491345
}
---
!u!114
&9174292048928438190
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
Assets/scripts/Views/maingame/GroupListManager.cs
View file @
836c6b67
...
...
@@ -5,6 +5,9 @@ using Unity.VisualScripting;
using
UnityEngine
;
using
UnityEngine.UI
;
using
System.Linq
;
using
DG.Tweening
;
using
static
UnityEditor
.
Progress
;
using
TMPro
;
public
class
GroupListManager
:
MonoBehaviour
{
...
...
@@ -14,6 +17,11 @@ public class GroupListManager : MonoBehaviour
public
ScrollRect
scrollview
;
//列表
public
GameObject
GroupItem_Obj
;
//要实例化的预制体
public
GridLayoutGroup
Content
;
public
float
ListMoveOffSet
=
35
;
public
GameObject
TipTitle
;
//提示文本
public
Slider
AllProcress
;
//總的進度
public
TextMeshProUGUI
AllProcress_Text
;
//百分比進度
private
List
<
colorItem
>
AllItem
=
new
List
<
colorItem
>();
private
void
Awake
()
...
...
@@ -24,6 +32,10 @@ public class GroupListManager : MonoBehaviour
void
Start
()
{
ResiterEvent
(
true
);
ChildSize
=
Content
.
cellSize
.
x
;
ChangeTipTitleState
(
true
);
AllProcress
.
gameObject
.
SetActive
(
true
);
AllProcress_Text
.
gameObject
.
SetActive
(
true
);
}
private
void
ResiterEvent
(
bool
flag
)
...
...
@@ -31,6 +43,10 @@ public class GroupListManager : MonoBehaviour
EventDispatcher
.
RegisterEvent
(
EventName
.
Event
.
Event_GroupListCreate
,
CreateGroup
,
flag
);
EventDispatcher
.
RegisterEvent
(
EventName
.
Event
.
Event_GropuItemChange
,
GroupItemChange
,
flag
);
}
public
void
ChangeTipTitleState
(
bool
flag
)
{
TipTitle
.
SetActive
(
flag
);
}
private
void
GroupItemChange
(
object
[]
values
)
{
...
...
@@ -60,7 +76,7 @@ public class GroupListManager : MonoBehaviour
tran
.
localRotation
=
Quaternion
.
Euler
(
0
,
0
,
0
);
tran
.
localScale
=
Vector3
.
one
;
NowJindu
=
(
float
)
item
.
roomIdsOver
.
Count
/
item
.
roomIds
.
Count
+
item
.
roomIdsOver
.
Count
;
//
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
);
coloritem
.
index
=
index
;
...
...
@@ -75,27 +91,74 @@ public class GroupListManager : MonoBehaviour
IEnumerator
Delay
()
{
yield
return
new
WaitForSeconds
(
0.1f
);
foreach
(
var
item
in
AllItem
)
{
yield
return
new
WaitForSeconds
(
0.05f
);
item
.
SetLocalRootPos
();
item
.
PlayInitAni
();
}
}
private
int
nowidx
=
0
;
private
int
oldindex
=
0
;
private
float
ChildSize
=
0
;
public
void
ClickItem
(
int
Gid
,
int
clickindex
)
{
ChangeTipTitleState
(
false
);
Vector3
clickpos
=
Vector3
.
zero
;
foreach
(
var
item
in
AllItem
)
{
item
.
IsSelect
=
item
.
GID
==
Gid
;
if
(
item
.
GID
==
Gid
)
{
clickpos
=
item
.
transform
.
localPosition
;
continue
;
}
item
.
ChangeLocalPos_Select
(
item
.
index
<
clickindex
,
clickindex
,
item
.
transform
.
localPosition
.
x
);
item
.
ChangeLocalPos_Select
(
item
.
index
<
clickindex
,
clickindex
,
clickpos
.
x
);
item
.
switchPlayAnimation
();
}
float
targetpos
;
oldindex
=
nowidx
;
nowidx
=
clickindex
;
if
(
oldindex
<
nowidx
)
//点的是右边的
{
if
(
nowidx
>=
5
)
{
targetpos
=
-(
ChildSize
*
(
nowidx
-
4
))
-
ListMoveOffSet
;
if
(
targetpos
<
Content
.
transform
.
localPosition
.
x
)
{
Content
.
transform
.
DOLocalMoveX
(
targetpos
,
1f
);
return
;
}
}
}
else
if
(
oldindex
>
nowidx
)
//点的左边的
{
targetpos
=
-(
ChildSize
*
(
nowidx
-
1
)
+
10
);
if
(
targetpos
>
Content
.
transform
.
localPosition
.
x
)
{
Content
.
transform
.
DOLocalMoveX
(
targetpos
,
1f
);
}
}
StartCoroutine
(
DelayToRefreshGrid
());
}
IEnumerator
DelayToRefreshGrid
()
{
yield
return
new
WaitForSeconds
(
0.2f
);
Transform
ItemParent
=
Content
.
transform
;
int
itemNum
=
ItemParent
.
childCount
;
Transform
item
;
for
(
int
i
=
0
;
i
<
itemNum
;
i
++)
{
item
=
ItemParent
.
GetChild
(
i
);
item
.
GetComponent
<
colorItem
>().
ReSetPos
();
}
}
}
Assets/scripts/perfabItems/colorItem.cs
View file @
836c6b67
...
...
@@ -107,45 +107,6 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
transform
.
DOScale
(
Vector3
.
one
*
NotSelectScale
,
0.2f
).
SetEase
(
Ease
.
OutSine
).
onComplete
=
()
=>
{
CanPlayAniFlag
=
false
;
};
}
}
public
void
switchPlayAnimation1
()
{
if
(
transform
==
null
)
return
;
RectTransform
rectTrans
=
transform
.
GetComponent
<
RectTransform
>();
//rectTrans.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 0.5f);
//rectTrans.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 0.5f);
if
(
isSelect
)
{
for
(
int
i
=
0
;
i
<
transform
.
childCount
;
i
++)
{
transform
.
GetChild
(
i
).
localScale
=
initScaleSize
[
i
];
}
ActionManages
.
addCallBackByLen
(
gameObject
,
0.18f
,
0.2f
,
(
float
value
)
=>
{
for
(
int
i
=
0
;
i
<
transform
.
childCount
;
i
++)
{
transform
.
GetChild
(
i
).
localScale
=
new
Vector2
(
initScaleSize
[
i
].
x
+
value
,
initScaleSize
[
i
].
y
+
value
);
}
});
}
else
{
for
(
int
i
=
0
;
i
<
transform
.
childCount
;
i
++)
{
transform
.
GetChild
(
i
).
localScale
=
new
Vector2
(
initScaleSize
[
i
].
x
+
0.18f
,
initScaleSize
[
i
].
y
+
0.18f
);
}
ActionManages
.
addCallBackByLen
(
gameObject
,
-
0.18f
,
0.2f
,
(
float
value
)
=>
{
for
(
int
i
=
0
;
i
<
transform
.
childCount
;
i
++)
{
transform
.
GetChild
(
i
).
localScale
=
new
Vector2
(
initScaleSize
[
i
].
x
+
value
,
initScaleSize
[
i
].
y
+
value
);
}
});
}
}
public
float
NowProgress
{
...
...
@@ -244,12 +205,6 @@ 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);
//}
GameMgr
.
Ins
.
ChooseGroup
(
GID
);
GroupListManager
.
Instance
.
ClickItem
(
GID
,
index
);
...
...
@@ -266,16 +221,12 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
if
(
left
)
//左边
{
//if (clickindex - 1 > index)
// return;
//transform.DOLocalMoveX(clickpos - 120 * (clickindex - index) - 5, 0.5f);
transform
.
DOLocalMoveX
(
LocalPos_Root
.
x
+
index
*
Size
,
0.2f
);
}
else
{
transform
.
DOLocalMoveX
(
clickpos
+
Size
*
(
index
-
clickindex
)
+
offset_dis
,
0.2f
);
//transform.DOLocalMoveX(LocalPos_Root.x + 120 * index + offset_dis, 0.5f);
}
}
...
...
@@ -294,7 +245,18 @@ public class colorItem : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
public
void
OnPointerUp
(
PointerEventData
eventData
)
{
if
(
IsSelect
)
//if(IsSelect)
// transform.DOScale(SelectScale, 0.2f);
//else
// transform.DOScale(NotSelectScale, 0.2f);
StartCoroutine
(
TestDelay
());
}
IEnumerator
TestDelay
()
{
yield
return
null
;
if
(
IsSelect
)
transform
.
DOScale
(
SelectScale
,
0.2f
);
else
transform
.
DOScale
(
NotSelectScale
,
0.2f
);
...
...
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