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
b24009f7
Commit
b24009f7
authored
Aug 01, 2023
by
shujianhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整分组文字大小和尝试动态调整分组单元大小
parent
be58a4d2
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
11 deletions
+39
-11
gameAreaGroupItem.prefab
Assets/Resources/perfabs/gameAreaGroupItem.prefab
+3
-3
gameClickEffect.prefab
Assets/Resources/perfabs/gameClickEffect.prefab
+1
-1
gameScene.unity
Assets/Scenes/gameScene.unity
+1
-1
gameSceneAreaGroupHandler.cs
Assets/scripts/Views/gameScene/gameSceneAreaGroupHandler.cs
+29
-1
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+4
-4
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+1
-1
No files found.
Assets/Resources/perfabs/gameAreaGroupItem.prefab
View file @
b24009f7
...
...
@@ -169,13 +169,13 @@ MonoBehaviour:
m_faceColor
:
serializedVersion
:
2
rgba
:
4294967295
m_fontSize
:
3
0
m_fontSizeBase
:
3
0
m_fontSize
:
4
0
m_fontSizeBase
:
4
0
m_fontWeight
:
400
m_enableAutoSizing
:
0
m_fontSizeMin
:
18
m_fontSizeMax
:
72
m_fontStyle
:
0
m_fontStyle
:
1
m_HorizontalAlignment
:
2
m_VerticalAlignment
:
512
m_textAlignment
:
65535
...
...
Assets/Resources/perfabs/gameClickEffect.prefab
View file @
b24009f7
...
...
@@ -28,7 +28,7 @@ RectTransform:
m_GameObject
:
{
fileID
:
5397047662947055783
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
0.
025
,
y
:
0.025
,
z
:
0
}
m_LocalScale
:
{
x
:
0.
2
,
y
:
0.2
,
z
:
0
}
m_ConstrainProportionsScale
:
0
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
...
...
Assets/Scenes/gameScene.unity
View file @
b24009f7
...
...
@@ -315,7 +315,7 @@ MonoBehaviour:
m_StartCorner
:
0
m_StartAxis
:
0
m_CellSize
:
{
x
:
280
,
y
:
280
}
m_Spacing
:
{
x
:
5
,
y
:
0
}
m_Spacing
:
{
x
:
30
,
y
:
0
}
m_Constraint
:
2
m_ConstraintCount
:
1
---
!u!1001
&1821187684178258737
...
...
Assets/scripts/Views/gameScene/gameSceneAreaGroupHandler.cs
View file @
b24009f7
...
...
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
Unity.VisualScripting
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
gameSceneAreaGroupHandler
:
gridView
{
...
...
@@ -21,6 +22,7 @@ public class gameSceneAreaGroupHandler : gridView
//}
// Start is called before the first frame update
public
float
sceneShowSize
=
6.0f
;
void
Start
()
{
RectTransform
rectTransform
=
transform
.
parent
.
Find
(
"bg"
).
GetComponent
<
RectTransform
>();
...
...
@@ -30,6 +32,32 @@ public class gameSceneAreaGroupHandler : gridView
// Update is called once per frame
void
Update
(){
}
public
void
autoResetCellSize
()
{
float
sceneWidth
=
utilsTools
.
DisplaySize
.
x
;
GameObject
gameObjectContext
=
GetComponent
<
ScrollRect
>().
content
.
gameObject
;
var
gridLayout
=
gameObjectContext
.
GetComponent
<
GridLayoutGroup
>();
if
(
gridLayout
!=
null
)
{
float
width1
=
sceneWidth
/
sceneShowSize
-
gridLayout
.
spacing
.
x
;
if
(
width1
*
sceneShowSize
>
sceneWidth
)
{
sceneShowSize
=
sceneShowSize
-
1
;
autoResetCellSize
();
return
;
}
float
bet
=
gridLayout
.
cellSize
.
x
/
width1
;
float
height1
=
gridLayout
.
cellSize
.
y
/
bet
;
float
desHeight
=
GetComponent
<
RectTransform
>().
rect
.
height
;
while
(
height1
>
desHeight
)
{
bet
=
bet
*
0.90f
;
height1
=
gridLayout
.
cellSize
.
y
/
bet
;
}
width1
=
gridLayout
.
cellSize
.
x
/
bet
;
gridLayout
.
cellSize
=
new
Vector2
(
width1
,
height1
);
}
}
public
void
setDataNoGrid
(
int
cout
,
gradViewBack
gradView
)
{
setData
(
cout
,(
GameObject
obj
,
int
idx
,
ListViewBackTypeEnum
lvb
)
=>
...
...
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
b24009f7
...
...
@@ -192,7 +192,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
private
void
onEvent_gameViewOnInitEnd_Handler
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
gridViewList
.
autoResetCellSize
();
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
var
groupInfos1
=
maingameView
.
getGroups
();
groupInfos
=
new
List
<
TempGroupInfos
>();
...
...
@@ -232,8 +232,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
//RectTransform rectTransform1 = gridViewList.GetComponent<RectTransform>();
RectTransform
rectTransform2
=
transform
.
Find
(
"tipSelectGroup"
).
GetComponent
<
RectTransform
>();
//float y = (utilsTools.DisplaySize.y / 2 - rectTransform1.rect.height / 2) * -1 + rectTransform2.rect.height + 25;
//rectTransform2.localPosition = new Vector3(rectTransform2.localPosition.x, y);
if
(
autoSwitchGroup
==
false
)
{
rectTransform2
.
gameObject
.
SetActive
(
true
);
...
...
@@ -289,6 +287,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
//transform1.localPosition = new Vector2(transform1.localPosition.x, offsetY + 35);
gameShowView
.
GetComponent
<
mainGameScaleMove
>().
setCheckInput
();
gameShowView
.
GetComponent
<
mainGameView
>().
showTimes
();
RectTransform
rectTransform2
=
transform
.
Find
(
"tipSelectGroup"
).
GetComponent
<
RectTransform
>();
rectTransform2
.
localPosition
=
new
Vector3
(
rectTransform2
.
localPosition
.
x
,
transform1
.
localPosition
.
y
-
10
);
}
private
void
handlerLoadingPosition
(
Image
image
)
...
...
Assets/scripts/perfabItems/colorItem.cs
View file @
b24009f7
...
...
@@ -123,6 +123,7 @@ public class colorItem : MonoBehaviour
else
{
s
=
s
-
10
;
v
=
v
-
10
;
}
}
s
=
s
/
100f
;
...
...
@@ -130,7 +131,6 @@ public class colorItem : MonoBehaviour
Color
color1
=
Color
.
HSVToRGB
(
h
,
s
,
v
);
effectImg
.
color2
=
color1
;
effectImg
.
color1
=
useColor
;
Debug
.
Log
(
"id = "
+
idName
+
" color1 = "
+
(
color1
*
255
).
ToString
()
+
" color2 = "
+
(
useColor
*
255
));
}
get
{
...
...
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