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
009ec99f
Commit
009ec99f
authored
Aug 09, 2023
by
JiangWanZhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一些UI的适配和组的列表调整
parent
f7558b48
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
516 additions
and
356 deletions
+516
-356
gameAreaGroupItem.prefab
Assets/Resources/perfabs/gameAreaGroupItem.prefab
+1
-1
gameViewLogic.prefab
Assets/Resources/perfabs/gameViewLogic.prefab
+263
-27
gameScene.unity
Assets/Scenes/gameScene.unity
+68
-253
gameSceneAreaGroupHandler.cs
Assets/scripts/Views/gameScene/gameSceneAreaGroupHandler.cs
+11
-0
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+45
-17
Native.cs
Assets/scripts/Views/maingame/Native.cs
+18
-0
gridView.cs
Assets/scripts/common/gridView.cs
+27
-9
mainGameView.cs
Assets/scripts/common/mainGameView.cs
+35
-31
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+48
-18
No files found.
Assets/Resources/perfabs/gameAreaGroupItem.prefab
View file @
009ec99f
...
...
@@ -36,7 +36,7 @@ RectTransform:
m_AnchorMin
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
12
0
,
y
:
120
}
m_SizeDelta
:
{
x
:
12
5
,
y
:
125
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&637148015308226340
CanvasRenderer
:
...
...
Assets/Resources/perfabs/gameViewLogic.prefab
View file @
009ec99f
This diff is collapsed.
Click to expand it.
Assets/Scenes/gameScene.unity
View file @
009ec99f
This diff is collapsed.
Click to expand it.
Assets/scripts/Views/gameScene/gameSceneAreaGroupHandler.cs
View file @
009ec99f
...
...
@@ -27,8 +27,19 @@ public class gameSceneAreaGroupHandler : gridView
{
RectTransform
rectTransform
=
transform
.
parent
.
Find
(
"bg"
).
GetComponent
<
RectTransform
>();
utilsTools
.
DisplaySize
=
new
Vector2
(
rectTransform
.
rect
.
width
,
rectTransform
.
rect
.
height
);
}
public
void
SetChild_ListPosData
()
{
var
content
=
transform
.
GetComponent
<
ScrollRect
>().
content
;
content
.
GetComponent
<
GridLayoutGroup
>().
enabled
=
false
;
for
(
int
i
=
0
;
i
<
content
.
childCount
;
i
++)
{
content
.
GetChild
(
i
).
GetComponent
<
colorItem
>().
SetLocalRootPos
();
}
}
// Update is called once per frame
void
Update
(){
}
...
...
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
009ec99f
...
...
@@ -70,16 +70,17 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
onEvent
(
"gamePlayerEndHandler"
,
onGamePlayerEndHandlerEvent
);
//整个大图都涂完了
onEvent
(
"closeGameScene"
,
onCloseGameSceneEvent
);
//关游戏
onEvent
(
"removeGroupByGid"
,
onRemoveGroupByGidEvent
);
//自动涂gid不一致会调过来
onEvent
(
"GroupIsLoadOver"
,
onGroupIsLoadOver
);
//组的成员加载完成
transform
.
Find
(
"ingameLoad/loadImg"
).
gameObject
.
SetActive
(
false
);
//gameScenUser
var
gridViewList
=
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>();
gridViewList
.
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"groupListBg"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"gameProgressText"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"gameProgress
/gameProgress
Text"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"gameProgress"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"gameEndOperBase"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"gameEndOperBase"
).
GetComponent
<
gameEndLogic
>().
initMember
();
transform
.
Find
(
"tipSelectGroup"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"
areaGroupList/
tipSelectGroup"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"top"
).
gameObject
.
SetActive
(
false
);
utilsTools
.
setGDataByKey
(
"PhoneOffsetValue"
,
50
);
utilsTools
.
addTimer_Sec
(
gameObject
,
"loopGetHot"
,
(
String
name
)
=>
...
...
@@ -91,11 +92,21 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
addHotParams
<
int
>(
"TUSE_PhoneOffsetValue"
,
"PhoneOffsetValue"
,
int
.
TryParse
);
return
true
;
},
3
,
0
);
utilsTools
.
resetGameObjectTreeSize
(
gameObject
,
(
String
path
)
=>
//utilsTools.resetGameObjectTreeSize(gameObject, (String path) =>
//{
// if (path.IndexOf("/top/") > 0) return 1;
// return 0;
//});
}
private
void
onGroupIsLoadOver
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
object
>
objects
)
{
if
(
path
.
IndexOf
(
"/top/"
)
>
0
)
return
1
;
return
0
;
});
StartCoroutine
(
TestDelay
());
}
IEnumerator
TestDelay
()
{
yield
return
new
WaitForSeconds
(
0.5f
);
areaGroupList
.
GetComponent
<
gameSceneAreaGroupHandler
>().
SetChild_ListPosData
();
}
void
addHotParams
<
T
>(
string
netKey
,
string
localKey
,
StringOutTValue
<
T
>
back
,
NotifyBoolParam
notifyBoolParam
=
null
)
...
...
@@ -183,7 +194,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
item
=
gridViewList
.
getObjectById
(
nowidx
).
GetComponent
<
colorItem
>();
item
.
IsSelect
=
false
;
item
.
transform
.
GetLocalPositionAndRotation
(
out
vector3
,
out
quaternion
);
vector3
.
y
=
vector3
.
y
-
14
;
//
vector3.y = vector3.y - 14;
item
.
transform
.
SetLocalPositionAndRotation
(
vector3
,
quaternion
);
item
.
updateOneUI
();
item
.
switchPlayAnimation
();
...
...
@@ -195,15 +206,27 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
item
=
gridViewList
.
getObjectById
(
idx
).
GetComponent
<
colorItem
>();
item
.
IsSelect
=
true
;
item
.
transform
.
GetLocalPositionAndRotation
(
out
vector3
,
out
quaternion
);
vector3
.
y
=
vector3
.
y
+
14
;
//
vector3.y = vector3.y + 14;
item
.
transform
.
SetLocalPositionAndRotation
(
vector3
,
quaternion
);
item
.
switchPlayAnimation
();
maingameView
.
switchShowAreaGroup
((
short
)
nowSelectGroupId
,
(
int
id
,
bool
isOk
)
=>
{
if
(
isOk
)
{
transform
.
Find
(
"tipSelectGroup"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"
areaGroupList/
tipSelectGroup"
).
gameObject
.
SetActive
(
false
);
}
});
Transform
item_obj
;
for
(
int
i
=
0
;
i
<
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>().
content
.
childCount
;
i
++)
{
if
(
i
==
nowidx
)
continue
;
item_obj
=
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>().
content
.
GetChild
(
i
);
item_obj
.
GetComponent
<
colorItem
>().
ChangeLocalPos_Select
(
i
<
nowidx
,
nowidx
,
item
.
transform
.
localPosition
.
x
);
}
}
//游戏图片初始化完成
private
void
onEvent_gameViewOnInitEnd_Handler
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
...
...
@@ -249,13 +272,15 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
});
}
//RectTransform rectTransform1 = gridViewList.GetComponent<RectTransform>();
RectTransform
rectTransform2
=
transform
.
Find
(
"tipSelectGroup"
).
GetComponent
<
RectTransform
>();
RectTransform
rectTransform2
=
transform
.
Find
(
"
areaGroupList/
tipSelectGroup"
).
GetComponent
<
RectTransform
>();
if
(
autoSwitchGroup
==
false
)
{
rectTransform2
.
gameObject
.
SetActive
(
true
);
maingameView
.
GetComponent
<
mainGameScaleMove
>().
setCheckInput
();
utilsTools
.
sendEventObjectParams
(
"inGameLoadingValue"
,
100f
,
true
);
}
}
private
bool
phoneClickByPos
(
ref
mainGameView
mainview
,
short
x
,
short
y
,
short
faulTolerant
,
bool
isFirst
)
{
...
...
@@ -335,7 +360,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
short
y
=
(
short
)
objects
[
1
];
if
(
nowidx
<
0
)
{
transform
.
Find
(
"tipSelectGroup"
).
gameObject
.
SetActive
(
true
);
transform
.
Find
(
"
areaGroupList/
tipSelectGroup"
).
gameObject
.
SetActive
(
true
);
return
;
}
var
maingameView
=
gameShowView
.
GetComponent
<
mainGameView
>();
...
...
@@ -357,7 +382,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
transform
.
Find
(
"ingameLoad"
).
gameObject
.
SetActive
(
false
);
transform
.
Find
(
"top"
).
gameObject
.
SetActive
(
true
);
utilsTools
.
setGDataByKey
(
"loadingEnd"
,
utilsTools
.
getTotalMillisecond
());
RectTransform
transform1
=
transform
.
Find
(
"gameProgressText"
).
GetComponent
<
RectTransform
>();
RectTransform
transform1
=
transform
.
Find
(
"gameProgress
/gameProgress
Text"
).
GetComponent
<
RectTransform
>();
transform1
.
gameObject
.
SetActive
(
true
);
transform1
=
transform
.
Find
(
"gameProgress"
).
GetComponent
<
RectTransform
>();
transform1
.
gameObject
.
SetActive
(
true
);
...
...
@@ -418,7 +443,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
Sprite
sprite
=
Sprite
.
Create
(
texture2d
,
new
Rect
(
0
,
0
,
texture2d
.
width
,
texture2d
.
height
),
new
Vector2
(
0.5f
,
0.5f
));
image
.
sprite
=
sprite
;
image
.
color
=
new
Color
(
1
,
1
,
1
,
1
);
autoSwitchGroup
=
Boolean
.
Parse
(
utilsTools
.
getGDataByKey
<
string
>(
"auto_switch"
,
autoSwitchGroup
.
ToString
()));
autoSwitchGroup
=
true
;
//
Boolean.Parse(utilsTools.getGDataByKey<string>("auto_switch", autoSwitchGroup.ToString()));
if
(
autoSwitchGroup
==
false
)
nowidx
=
-
1
;
vibration
=
Boolean
.
Parse
(
utilsTools
.
getGDataByKey
<
string
>(
"vibration"
,
vibration
.
ToString
()));
this
.
handlerLoadingPosition
(
image
);
...
...
@@ -533,7 +558,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
void
onChangeGameUserProgressEvent
(
List
<
UnityEngine
.
Object
>
uobjects
,
List
<
System
.
Object
>
objects
)
{
int
pro
=
(
int
)
objects
[
0
];
transform
.
Find
(
"ingameLoad"
).
gameObject
.
SetActive
(
false
);
TextMeshProUGUI
textMeshPro
=
transform
.
Find
(
"gameProgressText"
).
GetComponent
<
TextMeshProUGUI
>();
TextMeshProUGUI
textMeshPro
=
transform
.
Find
(
"gameProgress
/gameProgress
Text"
).
GetComponent
<
TextMeshProUGUI
>();
textMeshPro
.
text
=
pro
.
ToString
()
+
"%"
;
UnityEngine
.
UI
.
Slider
slider
=
transform
.
Find
(
"gameProgress"
).
GetComponent
<
UnityEngine
.
UI
.
Slider
>();
slider
.
value
=
pro
;
...
...
@@ -575,7 +600,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
short
x
=
(
short
)
objects
[
1
];
short
y
=
(
short
)
objects
[
2
];
short
nowAidByGid
=
gameArea
.
gid
;
if
(
nowAidByGid
!=
nowidx
)
return
;
if
(
groupInfos
.
Count
.
Equals
(
0
)
||
nowidx
<
0
)
return
;
if
(
groupInfos
[
nowidx
].
gid
.
Equals
(
nowAidByGid
)
==
false
)
return
;
if
(
groupInfos
!=
null
)
{
int
operId
=
-
1
;
...
...
@@ -691,6 +717,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
Debug
.
Log
(
tempJsondata
);
}
gameShowView
.
GetComponent
<
mainGameView
>().
onClear
();
int
index
=
utilsTools
.
getGDataByKey
<
int
>(
"testIdx"
,
0
);
utilsTools
.
setGDataByKey
(
"testIdx"
,
++
index
);
SceneManager
.
LoadScene
(
"Scenes/MainGame"
);
return
false
;
},
40
);
...
...
Assets/scripts/Views/maingame/Native.cs
View file @
009ec99f
This diff is collapsed.
Click to expand it.
Assets/scripts/common/gridView.cs
View file @
009ec99f
...
...
@@ -5,6 +5,7 @@ using System.Runtime.CompilerServices;
using
Unity.VisualScripting
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
static
UnityEngine
.
Rendering
.
DebugUI
.
Table
;
public
class
gridView
:
MonoBehaviour
{
...
...
@@ -213,19 +214,35 @@ public class gridView : MonoBehaviour
childTransform
.
SetParent
(
null
);
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
)
{
Vector2
shipei
=
new
Vector2
(
widthItem
,
heightItem
);
utilsTools
.
DeviceAdaptationSize
(
ref
shipei
);
widthItem
=
shipei
.
x
;
heightItem
=
shipei
.
y
;
shipei
.
x
=
interval
;
shipei
.
y
=
offset1
;
utilsTools
.
DeviceAdaptationSize
(
ref
shipei
);
interval
=
shipei
.
x
;
offset1
=
shipei
.
y
;
//
Vector2 shipei = new Vector2 (widthItem,heightItem);
//
utilsTools.DeviceAdaptationSize(ref shipei);
//
widthItem = shipei.x;
//
heightItem = shipei.y;
//
shipei.x = interval;
//
shipei.y = offset1;
//
utilsTools.DeviceAdaptationSize(ref shipei);
//
interval = shipei.x;
//
offset1 = shipei.y;
if
(
perfabPaths
.
Count
==
0
)
{
perfabPaths
.
Add
(
perfabPath
);
...
...
@@ -367,5 +384,6 @@ public class gridView : MonoBehaviour
childTransform
.
SetParent
(
null
);
GameObject
.
Destroy
(
childTransform
.
gameObject
);
}
utilsTools
.
sendEventObjectParams
(
"GroupIsLoadOver"
,
null
);
}
}
Assets/scripts/common/mainGameView.cs
View file @
009ec99f
...
...
@@ -469,6 +469,10 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
for
(
int
i
=
0
;
i
<
gameidJsondata
.
roomDatas
.
Count
;
i
++)
{
var
item
=
gameidJsondata
.
roomDatas
[
i
];
if
(
item
.
IsValid
()
==
false
)
{
continue
;
}
if
(
digitMatrix
.
Data
[
item
.
px
,
item
.
py
]
>=
20
)
{
item
.
tempExKey
=
"idFlg_"
+
item
.
gid
.
ToString
()
+
"_"
+
item
.
id
.
ToString
();
...
...
@@ -1103,43 +1107,43 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
{
baseUpdate
();
if
(
Input
.
mouseScrollDelta
.
y
<
0
)
//滚轮向前滚动
{
var
scal
=
new
Vector3
(
transform
.
localScale
.
x
-
Input
.
mouseScrollDelta
.
y
,
transform
.
localScale
.
y
-
Input
.
mouseScrollDelta
.
y
,
0
);
if
(
scal
.
x
>
5
)
scal
=
Vector3
.
one
*
5
;
transform
.
localScale
=
scal
;
}
if
(
Input
.
mouseScrollDelta
.
y
>
0
)
//滚轮向后滚动
{
var
scal
=
new
Vector3
(
transform
.
localScale
.
x
+
Input
.
mouseScrollDelta
.
y
,
transform
.
localScale
.
y
+
Input
.
mouseScrollDelta
.
y
,
0
);
if
(
scal
.
x
<
1
)
scal
=
Vector3
.
one
;
transform
.
localScale
=
scal
;
}
//
if (Input.mouseScrollDelta.y < 0) //滚轮向前滚动
//
{
//
var scal = new Vector3(transform.localScale.x - Input.mouseScrollDelta.y, transform.localScale.y - Input.mouseScrollDelta.y, 0);
//
if (scal.x > 5)
//
scal = Vector3.one * 5;
//
transform.localScale = scal;
//
}
//
if (Input.mouseScrollDelta.y > 0) //滚轮向后滚动
//
{
//
var scal = new Vector3(transform.localScale.x + Input.mouseScrollDelta.y, transform.localScale.y + Input.mouseScrollDelta.y, 0);
//
if (scal.x < 1)
//
scal = Vector3.one;
//
transform.localScale = scal;
//
}
if
(
Input
.
GetMouseButton
(
0
))
//暂时先这样实现编辑器里的鼠标拖动
{
if
(
flag
)
{
mouse_oldpos
=
mouse_nowpos
;
mouse_nowpos
=
Input
.
mousePosition
;
//
if (Input.GetMouseButton(0)) //暂时先这样实现编辑器里的鼠标拖动
//
{
//
if (flag)
//
{
//
mouse_oldpos = mouse_nowpos;
//
mouse_nowpos = Input.mousePosition;
var
pos_x
=
mouse_nowpos
.
x
-
mouse_oldpos
.
x
;
var
pos_y
=
mouse_nowpos
.
y
-
mouse_oldpos
.
y
;
//
var pos_x = mouse_nowpos.x - mouse_oldpos.x;
//
var pos_y=mouse_nowpos.y- mouse_oldpos.y;
transform
.
localPosition
=
new
Vector3
(
transform
.
localPosition
.
x
+
pos_x
,
transform
.
localPosition
.
y
+
pos_y
,
0
);
//
transform.localPosition = new Vector3(transform.localPosition.x + pos_x, transform.localPosition.y + pos_y, 0);
}
else
{
mouse_oldpos
=
Input
.
mousePosition
;
}
mouse_nowpos
=
Input
.
mousePosition
;
flag
=
true
;
//
}
//
else
//
{
//
mouse_oldpos = Input.mousePosition;
//
}
//
mouse_nowpos = Input.mousePosition;
//
flag = true;
}
//
}
if
(
Input
.
GetMouseButtonUp
(
0
))
{
flag
=
false
;
...
...
Assets/scripts/perfabItems/colorItem.cs
View file @
009ec99f
using
DG.Tweening
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
...
...
@@ -23,6 +24,8 @@ public class colorItem : MonoBehaviour
private
List
<
Vector2
>
initScaleSize
=
new
List
<
Vector2
>();
private
float
offset
=
0
;
private
Vector3
LocalPos_Root
;
//记录实例化出来后在本地的原始坐标
void
initMember
()
{
if
(
effectImg
==
null
)
...
...
@@ -34,6 +37,7 @@ public class colorItem : MonoBehaviour
normalScale
=
transform
.
localScale
*
0.85f
;
transform
.
localScale
=
normalScale
;
}
transform
.
localScale
=
Vector3
.
one
*
0.8f
;
}
public
bool
IsSelect
{
...
...
@@ -58,31 +62,39 @@ public class colorItem : MonoBehaviour
if
(
transform
==
null
)
return
;
RectTransform
rectTransform
=
(
RectTransform
)
transform
;
float
x
=
transform
.
localPosition
.
x
;
//if (isSelect)
//{
// transform.localPosition = new Vector2(x, 0 - (transform.localScale.y * rectTransform.rect.height) / 2 - offset);
// transform.localScale = normalScale;
// ActionManages.addMoveByScale(gameObject, normalScale * 1.2f, 0.25f);
//}
//else
//{
// transform.localScale = normalScale * 1.2f;
// transform.localPosition = new Vector2(x, 0 - (transform.localScale.y * rectTransform.rect.height) / 2 - offset);
// ActionManages.addMoveByScale(gameObject, normalScale, 0.25f);
//}
if
(
isSelect
)
{
transform
.
localPosition
=
new
Vector2
(
x
,
0
-
(
transform
.
localScale
.
y
*
rectTransform
.
rect
.
height
)
/
2
-
offset
);
transform
.
localScale
=
normalScale
;
ActionManages
.
addMoveByScale
(
gameObject
,
normalScale
*
1.2f
,
0.25f
);
transform
.
DOScale
(
Vector3
.
one
*
0.9f
,
0.5f
);
}
else
{
transform
.
localScale
=
normalScale
*
1.2f
;
transform
.
localPosition
=
new
Vector2
(
x
,
0
-
(
transform
.
localScale
.
y
*
rectTransform
.
rect
.
height
)
/
2
-
offset
);
ActionManages
.
addMoveByScale
(
gameObject
,
normalScale
,
0.25f
);
transform
.
DOScale
(
Vector3
.
one
*
0.8f
,
0.5f
);
}
ActionManages
.
addCallBackByLen
(
gameObject
,
1000
,
0.25f
,
(
float
_
)
=>
{
//transform.localPosition = new Vector2(x, 0 - (transform.localScale.y * rectTransform.rect.height) / 2 - offset);
rectTransform
.
anchoredPosition
=
new
Vector2
(
rectTransform
.
anchoredPosition
.
x
,
0
);
},
(
GameObject
gobject
,
int
id
)
=>
{
//float a = transform.localScale.y * rectTransform.rect.height;
//transform.localPosition = new Vector2(x, 0 - (transform.localScale.y * rectTransform.rect.height) / 2 - offset);
rectTransform
.
anchoredPosition
=
new
Vector2
(
rectTransform
.
anchoredPosition
.
x
,
0
);
});
//ActionManages.addCallBackByLen(gameObject, 1000, 0.25f, (float _) =>
//{
// //transform.localPosition = new Vector2(x, 0 - (transform.localScale.y * rectTransform.rect.height) / 2 - offset);
// rectTransform.anchoredPosition = new Vector2(rectTransform.anchoredPosition.x, 0);
//}, (GameObject gobject, int id) =>
//{
// //float a = transform.localScale.y * rectTransform.rect.height;
// //transform.localPosition = new Vector2(x, 0 - (transform.localScale.y * rectTransform.rect.height) / 2 - offset);
// rectTransform.anchoredPosition = new Vector2(rectTransform.anchoredPosition.x, 0);
//});
}
public
void
switchPlayAnimation1
()
{
...
...
@@ -204,7 +216,6 @@ public class colorItem : MonoBehaviour
// Start is called before the first frame update
void
Start
()
{
Debug
.
LogError
(
$"Test
{
transform
.
name
}
"
);
initMember
();
//IsSelect = isSelect;
//IdName = idName;
...
...
@@ -236,4 +247,23 @@ public class colorItem : MonoBehaviour
public
void
resetSize
(
float
x
,
float
y
)
{
}
public
void
SetLocalRootPos
()
//保存一下本地的原始坐标
{
LocalPos_Root
=
transform
.
localPosition
;
}
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);
}
else
{
transform
.
DOLocalMoveX
(
clickpos
+
120
*
(
index
-
clickindex
)
+
20
,
0.5f
);
//transform.DOLocalMoveX(LocalPos_Root.x + 10, 0.5f);
}
}
}
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