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
835ea7bb
Commit
835ea7bb
authored
Aug 10, 2023
by
JiangWanZhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新点击组的表现
parent
a23aca39
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
171 additions
and
71 deletions
+171
-71
gameAreaGroupItem.prefab
Assets/Resources/perfabs/gameAreaGroupItem.prefab
+1
-1
gameViewLogic.prefab
Assets/Resources/perfabs/gameViewLogic.prefab
+3
-3
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+132
-56
gridView.cs
Assets/scripts/common/gridView.cs
+19
-4
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+15
-6
ProjectSettings.asset
ProjectSettings/ProjectSettings.asset
+1
-1
No files found.
Assets/Resources/perfabs/gameAreaGroupItem.prefab
View file @
835ea7bb
...
@@ -421,4 +421,4 @@ MonoBehaviour:
...
@@ -421,4 +421,4 @@ MonoBehaviour:
idName
:
12
idName
:
12
useColor
:
{
r
:
0.9612525
,
g
:
0.9811321
,
b
:
0
,
a
:
1
}
useColor
:
{
r
:
0.9612525
,
g
:
0.9811321
,
b
:
0
,
a
:
1
}
index
:
0
index
:
0
selectLang
:
0.
2
5
selectLang
:
0.
0
5
Assets/Resources/perfabs/gameViewLogic.prefab
View file @
835ea7bb
...
@@ -2971,11 +2971,11 @@ MonoBehaviour:
...
@@ -2971,11 +2971,11 @@ MonoBehaviour:
m_Bottom
:
0
m_Bottom
:
0
m_ChildAlignment
:
0
m_ChildAlignment
:
0
m_StartCorner
:
0
m_StartCorner
:
0
m_StartAxis
:
0
m_StartAxis
:
1
m_CellSize
:
{
x
:
120
,
y
:
120
}
m_CellSize
:
{
x
:
120
,
y
:
120
}
m_Spacing
:
{
x
:
0
,
y
:
0
}
m_Spacing
:
{
x
:
0
,
y
:
0
}
m_Constraint
:
0
m_Constraint
:
2
m_ConstraintCount
:
2
m_ConstraintCount
:
1
---
!u!1
&6769909122946713645
---
!u!1
&6769909122946713645
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
...
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
835ea7bb
This diff is collapsed.
Click to expand it.
Assets/scripts/common/gridView.cs
View file @
835ea7bb
using
ICSharpCode.SharpZipLib
;
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.CompilerServices
;
using
Unity.VisualScripting
;
using
Unity.VisualScripting
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
UnityEngine.UI
;
using
static
UnityEngine
.
Rendering
.
DebugUI
.
Table
;
using
static
UnityEngine
.
Rendering
.
DebugUI
.
Table
;
using
Debug
=
UnityEngine
.
Debug
;
public
class
gridView
:
MonoBehaviour
public
class
gridView
:
MonoBehaviour
{
{
...
@@ -70,6 +73,19 @@ public class gridView : MonoBehaviour
...
@@ -70,6 +73,19 @@ public class gridView : MonoBehaviour
}
}
return
transfromitem
.
gameObject
;
return
transfromitem
.
gameObject
;
}
}
//根据组的ID获取列表对应的物体
public
Transform
GetObjByGID
(
int
Gid
)
{
Transform
parent
=
transform
.
GetComponent
<
ScrollRect
>().
content
;
for
(
int
i
=
0
;
i
<
parent
.
childCount
;
i
++)
{
var
item
=
parent
.
GetChild
(
i
).
GetComponent
<
colorItem
>();
if
(
item
.
GID
==
Gid
)
return
item
.
transform
;
}
return
null
;
}
virtual
public
Vector2
getOffset
()
virtual
public
Vector2
getOffset
()
{
{
var
gameObjectContext
=
GetComponent
<
ScrollRect
>();
var
gameObjectContext
=
GetComponent
<
ScrollRect
>();
...
@@ -170,9 +186,8 @@ public class gridView : MonoBehaviour
...
@@ -170,9 +186,8 @@ public class gridView : MonoBehaviour
{
{
w
=
width
-
w
;
w
=
width
-
w
;
}
}
rectTransform
.
sizeDelta
=
new
Vector2
(
w
,
rectTransform
.
sizeDelta
.
y
);
rectTransform
.
sizeDelta
=
new
Vector2
(
w
,
rectTransform
.
sizeDelta
.
y
);
}
}
Vector3
vector3
=
new
Vector3
();
utilsTools
.
setGDataByKey
(
"listViewTempCellSize"
,
new
Vector2
(
gridLayout
.
cellSize
.
x
,
gridLayout
.
cellSize
.
y
));
utilsTools
.
setGDataByKey
(
"listViewTempCellSize"
,
new
Vector2
(
gridLayout
.
cellSize
.
x
,
gridLayout
.
cellSize
.
y
));
for
(
int
i
=
0
;
i
<
size
;
i
++)
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
{
...
@@ -285,7 +300,7 @@ public class gridView : MonoBehaviour
...
@@ -285,7 +300,7 @@ public class gridView : MonoBehaviour
startY
=
0
-
h
/
2
+
heightItem
/
2
-
(
heightItem
/
2
+
interval
/
2
);
startY
=
0
-
h
/
2
+
heightItem
/
2
-
(
heightItem
/
2
+
interval
/
2
);
vector3
.
x
=
0
-
rectTransform
.
sizeDelta
.
x
/
2
-
offset1
;
vector3
.
x
=
0
-
rectTransform
.
sizeDelta
.
x
/
2
-
offset1
;
float
spacingLen
=
interval
*
(
size
-
1
);
float
spacingLen
=
interval
*
(
size
-
1
);
float
height
=
spacingLen
+
coutPixel
;
float
height
=
coutPixel
;
if
(
height
>
h
)
if
(
height
>
h
)
{
{
h
=
height
;
h
=
height
;
...
@@ -298,7 +313,7 @@ public class gridView : MonoBehaviour
...
@@ -298,7 +313,7 @@ public class gridView : MonoBehaviour
vector3
.
y
=
0
-
rectTransform
.
sizeDelta
.
y
/
2
-
offset1
;
//0 - rectTransform.sizeDelta.y / 2 - offset1;
vector3
.
y
=
0
-
rectTransform
.
sizeDelta
.
y
/
2
-
offset1
;
//0 - rectTransform.sizeDelta.y / 2 - offset1;
startX
=
0
-
w
/
2
+
widthItem
/
2
-
(
widthItem
/
2
+
interval
/
2
);
startX
=
0
-
w
/
2
+
widthItem
/
2
-
(
widthItem
/
2
+
interval
/
2
);
float
spacingLen
=
interval
*
(
size
-
1
);
float
spacingLen
=
interval
*
(
size
-
1
);
float
width
=
spacingLen
+
coutPixel
;
float
width
=
coutPixel
;
if
(
width
>
w
)
if
(
width
>
w
)
{
{
w
=
width
-
w
;
w
=
width
-
w
;
...
...
Assets/scripts/perfabItems/colorItem.cs
View file @
835ea7bb
...
@@ -19,25 +19,33 @@ public class colorItem : MonoBehaviour
...
@@ -19,25 +19,33 @@ public class colorItem : MonoBehaviour
private
Color
useColor
=
new
Color
();
private
Color
useColor
=
new
Color
();
public
int
index
=
0
;
public
int
index
=
0
;
public
float
selectLang
=
0.05f
;
public
float
selectLang
=
0.05f
;
private
int
gID
;
public
int
GID
//组ID
{
get
{
return
gID
;
}
set
{
gID
=
value
;
}
}
private
gameGroupEffect
effectImg
=
null
;
private
gameGroupEffect
effectImg
=
null
;
private
Vector3
normalScale
=
Vector3
.
one
;
private
Vector3
normalScale
=
Vector3
.
one
;
private
List
<
Vector2
>
initScaleSize
=
new
List
<
Vector2
>();
private
List
<
Vector2
>
initScaleSize
=
new
List
<
Vector2
>();
private
float
offset
=
0
;
private
float
offset
=
0
;
private
Vector3
LocalPos_Root
;
//记录实例化出来后在本地的原始坐标
private
Vector3
LocalPos_Root
;
//记录实例化出来后在本地的原始坐标
void
initMember
()
void
initMember
()
{
{
if
(
effectImg
==
null
)
if
(
effectImg
==
null
)
{
{
Vector2
listViewTempCellSize
=
utilsTools
.
getGDataByKey
<
Vector2
>(
"listViewTempCellSize"
,
Vector2
.
zero
);
Vector2
listViewTempCellSize
=
utilsTools
.
getGDataByKey
<
Vector2
>(
"listViewTempCellSize"
,
Vector2
.
zero
);
Vector2
listViewContextCellSize
=
utilsTools
.
getGDataByKey
<
Vector2
>(
"listViewContextCellSize"
,
Vector2
.
zero
);
Vector2
listViewContextCellSize
=
utilsTools
.
getGDataByKey
<
Vector2
>(
"listViewContextCellSize"
,
Vector2
.
zero
);
offset
=
(
listViewContextCellSize
.
y
-
listViewTempCellSize
.
y
)
/
2f
;
offset
=
(
listViewContextCellSize
.
y
-
listViewTempCellSize
.
y
)
/
2f
;
effectImg
=
transform
.
Find
(
"circle"
).
GetComponent
<
gameGroupEffect
>();
effectImg
=
transform
.
Find
(
"circle"
).
GetComponent
<
gameGroupEffect
>();
normalScale
=
transform
.
localScale
*
0.85f
;
normalScale
=
transform
.
localScale
*
0.85f
;
transform
.
localScale
=
normalScale
;
transform
.
localScale
=
normalScale
;
}
}
transform
.
localScale
=
Vector3
.
one
*
0.8f
;
}
}
public
bool
IsSelect
public
bool
IsSelect
{
{
...
@@ -149,7 +157,8 @@ public class colorItem : MonoBehaviour
...
@@ -149,7 +157,8 @@ public class colorItem : MonoBehaviour
}
}
nowProgress
=
value
;
nowProgress
=
value
;
bool
isend
=
this
.
isFinish
();
bool
isend
=
this
.
isFinish
();
effectImg
.
Height
=
1.0f
-
nowProgress
;
//effectImg.Height = 1.0f - nowProgress;
effectImg
.
Height
=
nowProgress
;
transform
.
Find
(
"idname"
).
gameObject
.
SetActive
(!
isend
);
transform
.
Find
(
"idname"
).
gameObject
.
SetActive
(!
isend
);
if
(
isend
)
if
(
isend
)
{
{
...
...
ProjectSettings/ProjectSettings.asset
View file @
835ea7bb
...
@@ -784,7 +784,7 @@ PlayerSettings:
...
@@ -784,7 +784,7 @@ PlayerSettings:
embeddedLinuxEnableGamepadInput
:
1
embeddedLinuxEnableGamepadInput
:
1
hmiLogStartupTiming
:
0
hmiLogStartupTiming
:
0
hmiCpuConfiguration
:
hmiCpuConfiguration
:
apiCompatibilityLevel
:
6
apiCompatibilityLevel
:
3
activeInputHandler
:
0
activeInputHandler
:
0
windowsGamepadBackendHint
:
0
windowsGamepadBackendHint
:
0
cloudProjectId
:
cloudProjectId
:
...
...
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