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
a23aca39
Commit
a23aca39
authored
Aug 10, 2023
by
JiangWanZhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组点击边缘的,会显示下一个或者上一个、把抗锯齿关了
parent
aab6aaf0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
45 deletions
+78
-45
gameViewLogic.prefab
Assets/Resources/perfabs/gameViewLogic.prefab
+2
-2
gameScene.unity
Assets/Scenes/gameScene.unity
+9
-9
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+52
-6
gridView.cs
Assets/scripts/common/gridView.cs
+0
-15
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+14
-12
QualitySettings.asset
ProjectSettings/QualitySettings.asset
+1
-1
No files found.
Assets/Resources/perfabs/gameViewLogic.prefab
View file @
a23aca39
...
...
@@ -3137,8 +3137,8 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
55
}
m_SizeDelta
:
{
x
:
0
,
y
:
-59
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
0
,
y
:
0
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&9176654368274725460
CanvasRenderer
:
...
...
Assets/Scenes/gameScene.unity
View file @
a23aca39
...
...
@@ -528,10 +528,10 @@ RectTransform:
m_Father
:
{
fileID
:
464840817
}
m_RootOrder
:
-1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
.5
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
750
,
y
:
1624
}
m_SizeDelta
:
{
x
:
0
,
y
:
0
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&1643100475
MonoBehaviour
:
...
...
@@ -1497,27 +1497,27 @@ PrefabInstance:
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4930126960711289547
,
guid
:
e2f00cfdb21d04b46adf17805f74f20c
,
type
:
3
}
propertyPath
:
m_AnchorMax.x
value
:
0.5
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4930126960711289547
,
guid
:
e2f00cfdb21d04b46adf17805f74f20c
,
type
:
3
}
propertyPath
:
m_AnchorMax.y
value
:
0.5
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4930126960711289547
,
guid
:
e2f00cfdb21d04b46adf17805f74f20c
,
type
:
3
}
propertyPath
:
m_AnchorMin.x
value
:
0
.5
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4930126960711289547
,
guid
:
e2f00cfdb21d04b46adf17805f74f20c
,
type
:
3
}
propertyPath
:
m_AnchorMin.y
value
:
0
.5
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4930126960711289547
,
guid
:
e2f00cfdb21d04b46adf17805f74f20c
,
type
:
3
}
propertyPath
:
m_SizeDelta.x
value
:
75
0
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4930126960711289547
,
guid
:
e2f00cfdb21d04b46adf17805f74f20c
,
type
:
3
}
propertyPath
:
m_SizeDelta.y
value
:
1624
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4930126960711289547
,
guid
:
e2f00cfdb21d04b46adf17805f74f20c
,
type
:
3
}
propertyPath
:
m_AnchoredPosition.x
...
...
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
a23aca39
using
Assets.scripts.Datas
;
using
DG.Tweening
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
...
...
@@ -24,6 +25,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
public
GameObject
gameShowView
=
null
;
public
GameObject
areaGroupList
=
null
;
private
int
nowidx
=
0
;
private
int
oldindex
=
0
;
public
float
progress
=
0
;
public
bool
showAreaId
=
true
;
private
List
<
TempGroupInfos
>
groupInfos
=
null
;
...
...
@@ -70,7 +72,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
onEvent
(
"gamePlayerEndHandler"
,
onGamePlayerEndHandlerEvent
);
//整个大图都涂完了
onEvent
(
"closeGameScene"
,
onCloseGameSceneEvent
);
//关游戏
onEvent
(
"removeGroupByGid"
,
onRemoveGroupByGidEvent
);
//自动涂gid不一致会调过来
onEvent
(
"GroupIsLoadOver"
,
onGroupIsLoadOver
);
//组的成员加载完成
onEvent
(
"GroupIsLoadOver"
,
onGroupIsLoadOver
);
//组的成员加载完成
,就是组列表下的item
transform
.
Find
(
"ingameLoad/loadImg"
).
gameObject
.
SetActive
(
false
);
//gameScenUser
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
...
...
@@ -101,9 +103,9 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
private
void
onGroupIsLoadOver
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
object
>
objects
)
{
StartCoroutine
(
TestDelay
());
StartCoroutine
(
DelayToSetListItemPos
());
}
IEnumerator
TestDelay
()
IEnumerator
DelayToSetListItemPos
()
{
yield
return
new
WaitForSeconds
(
0.5f
);
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>().
SetChild_ListPosData
();
...
...
@@ -201,6 +203,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
int
idx
=
(
int
)
objects
[
0
];
oldindex
=
nowidx
;
nowidx
=
idx
;
var
nowSelectGroupId
=
groupInfos
[
idx
].
gid
;
item
=
gridViewList
.
getObjectById
(
idx
).
GetComponent
<
colorItem
>();
...
...
@@ -217,16 +220,59 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
});
Transform
item_obj
;
for
(
int
i
=
0
;
i
<
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>().
content
.
childCount
;
i
++)
ScrollRect
Rect
=
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>();
float
targetpos
;
if
(
oldindex
<
nowidx
)
//点的是右边的
{
if
(
nowidx
>=
5
)
{
targetpos
=
-(
120
*
(
nowidx
-
4
)
-
20
+
5
*
2
);
if
(
targetpos
<
Rect
.
content
.
localPosition
.
x
)
{
Rect
.
content
.
DOLocalMoveX
(
targetpos
,
1f
);
return
;
}
}
}
else
if
(
oldindex
>
nowidx
)
//点的左边的
{
targetpos
=
-(
120
*
(
nowidx
-
1
)
+
10
);
if
(
targetpos
>
Rect
.
content
.
localPosition
.
x
)
{
Rect
.
content
.
DOLocalMoveX
(
targetpos
,
1f
);
return
;
}
}
int
itemNum
=
Rect
.
content
.
childCount
;
for
(
int
i
=
0
;
i
<
itemNum
;
i
++)
{
if
(
i
==
nowidx
)
continue
;
item_obj
=
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>()
.
content
.
GetChild
(
i
);
item_obj
=
Rect
.
content
.
GetChild
(
i
);
item_obj
.
GetComponent
<
colorItem
>().
ChangeLocalPos_Select
(
i
<
nowidx
,
nowidx
,
item
.
transform
.
localPosition
.
x
);
}
//StartCoroutine(DelayToRefreshGrid());
}
IEnumerator
DelayToRefreshGrid
()
{
yield
return
new
WaitForSeconds
(
0.6f
);
if
(
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>().
content
.
GetComponent
<
GridLayoutGroup
>().
enabled
)
{
LayoutRebuilder
.
ForceRebuildLayoutImmediate
(
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>().
content
.
GetComponent
<
RectTransform
>());
}
else
{
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>().
content
.
GetComponent
<
GridLayoutGroup
>().
enabled
=
true
;
}
}
//游戏图片初始化完成
private
void
onEvent_gameViewOnInitEnd_Handler
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
...
...
Assets/scripts/common/gridView.cs
View file @
a23aca39
...
...
@@ -215,21 +215,6 @@ public class gridView : MonoBehaviour
GameObject
.
Destroy
(
childTransform
.
gameObject
);
}
//if (transform.name== "areaGroupList")
//{
// StartCoroutine(TestDelay());
//}
}
IEnumerator
TestDelay
()
{
yield
return
new
WaitForSeconds
(
0.5f
);
var
content
=
transform
.
GetComponent
<
ScrollRect
>().
content
;
content
.
GetComponent
<
GridLayoutGroup
>().
gameObject
.
SetActive
(
false
);
for
(
int
i
=
0
;
i
<
content
.
childCount
;
i
++)
{
content
.
GetChild
(
i
).
GetComponent
<
colorItem
>().
SetLocalRootPos
();
}
}
//只支持一个预制体
virtual
public
void
setDataNoGrid
(
int
size
,
float
widthItem
,
float
heightItem
,
float
interval
,
gradViewBack
back
,
bool
useVec
=
true
,
GetGradViewInfo
getGradViewInfo
=
null
,
float
offset1
=
0.0f
)
...
...
Assets/scripts/perfabItems/colorItem.cs
View file @
a23aca39
...
...
@@ -77,7 +77,7 @@ public class colorItem : MonoBehaviour
if
(
isSelect
)
{
transform
.
DOScale
(
Vector3
.
one
*
0.9
f
,
0.5f
);
transform
.
DOScale
(
Vector3
.
one
*
0.95
f
,
0.5f
);
}
else
{
...
...
@@ -223,11 +223,6 @@ public class colorItem : MonoBehaviour
//NowProgress = nowProgress;
}
// Update is called once per frame
void
Update
()
{
}
public
bool
isFinish
()
{
return
utilsTools
.
isEqualByValue
(
nowProgress
,
1.0f
,
0.0000002f
);
...
...
@@ -248,22 +243,29 @@ public class colorItem : MonoBehaviour
{
}
public
void
SetLocalRootPos
()
//保存一下
本地
的原始坐标
public
void
SetLocalRootPos
()
//保存一下
第一个
的原始坐标
{
LocalPos_Root
=
transform
.
localPosition
;
LocalPos_Root
=
transform
.
parent
.
GetChild
(
0
).
localPosition
;
}
private
float
offset_dis
=
5
;
public
void
ChangeLocalPos_Select
(
bool
left
,
int
clickindex
,
float
clickpos
)
//当点击组的时候,其它往外面偏移一段
{
if
(
left
)
//左边
{
transform
.
DOLocalMoveX
(
clickpos
-
120
*
(
clickindex
-
index
)
-
20
,
0.5f
);
//transform.DOLocalMoveX(LocalPos_Root.x - 10, 0.5f);
//if (clickindex - 1 > index)
// return;
//transform.DOLocalMoveX(clickpos - 120 * (clickindex - index) - 5, 0.5f);
transform
.
DOLocalMoveX
(
LocalPos_Root
.
x
+
index
*
120
,
0.5f
);
}
else
{
transform
.
DOLocalMoveX
(
clickpos
+
120
*
(
index
-
clickindex
)
+
20
,
0.5f
);
//transform.DOLocalMoveX(LocalPos_Root.x + 10, 0.5f);
transform
.
DOLocalMoveX
(
clickpos
+
120
*
(
index
-
clickindex
)
+
offset_dis
,
0.5f
);
//transform.DOLocalMoveX(LocalPos_Root.x + 120 * index + offset_dis, 0.5f);
}
}
}
ProjectSettings/QualitySettings.asset
View file @
a23aca39
...
...
@@ -262,7 +262,7 @@ QualitySettings:
globalTextureMipmapLimit
:
0
textureMipmapLimitSettings
:
[]
anisotropicTextures
:
2
antiAliasing
:
8
antiAliasing
:
0
softParticles
:
1
softVegetation
:
1
realtimeReflectionProbes
:
1
...
...
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