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
aee5d078
Commit
aee5d078
authored
Aug 16, 2023
by
JiangWanZhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
屏蔽掉选中组去图片里面找区域的代码
parent
ee914e11
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
134 additions
and
28 deletions
+134
-28
Art.meta
Assets/Art.meta
+8
-0
Editor.meta
Assets/Editor.meta
+8
-0
CreateData_Test.cs
Assets/Editor/CreateData_Test.cs
+29
-0
CreateData_Test.cs.meta
Assets/Editor/CreateData_Test.cs.meta
+11
-0
gameAreaGroupItem.prefab
Assets/Resources/perfabs/gameAreaGroupItem.prefab
+5
-0
ScaleToImage.cs
Assets/scripts/ScaleToImage.cs
+11
-4
gameSceneLogic.cs
Assets/scripts/Views/gameScene/gameSceneLogic.cs
+11
-10
mainGameScaleMove.cs
Assets/scripts/common/mainGameScaleMove.cs
+0
-1
mainGameView.cs
Assets/scripts/common/mainGameView.cs
+12
-0
colorItem.cs
Assets/scripts/perfabItems/colorItem.cs
+39
-13
No files found.
Assets/Art.meta
0 → 100644
View file @
aee5d078
fileFormatVersion: 2
guid: a7c9d85320d683a45b35b656d3b79465
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Editor.meta
0 → 100644
View file @
aee5d078
fileFormatVersion: 2
guid: ba0791d5b40370c49a0a07f1ef3b7cc5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Editor/CreateData_Test.cs
0 → 100644
View file @
aee5d078
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEditor
;
public
class
CreateData_Test
:
EditorWindow
{
private
string
Path
;
[
MenuItem
(
"Tools/测试窗口"
)]
public
static
void
ShowWindow
()
{
GetWindow
<
CreateData_Test
>().
Show
();
}
private
void
OnGUI
()
{
GUILayout
.
Label
(
"选择文件夹"
,
EditorStyles
.
boldLabel
);
if
(
GUILayout
.
Button
(
"选择文件"
))
{
Path
=
EditorUtility
.
OpenFolderPanel
(
"请选择文件"
,
""
,
""
);
}
if
(
GUILayout
.
Button
(
"文件路径"
))
{
Debug
.
LogError
(
$"Path:
{
Path
}
"
);
}
}
}
Assets/Editor/CreateData_Test.cs.meta
0 → 100644
View file @
aee5d078
fileFormatVersion: 2
guid: dd8c6202c5cdf0f41b640f72eda61c18
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Resources/perfabs/gameAreaGroupItem.prefab
View file @
aee5d078
...
...
@@ -481,4 +481,9 @@ MonoBehaviour:
selectLang
:
0.05
Image_DI
:
{
fileID
:
8992132832858212788
}
Image_Jindu
:
{
fileID
:
6976011184890120279
}
SelectScale
:
0.9
NotSelectScale
:
0.8
SelectAniScale
:
0.95
SelectButtonDownScale
:
0.85
NotSelectButtonDownScale
:
0.75
CanPlayAniFlag
:
0
Assets/scripts/ScaleToImage.cs
View file @
aee5d078
...
...
@@ -166,12 +166,13 @@ public class ScaleToImage : MonoBehaviour
}
private
bool
CanPlayLerpFlag
;
private
void
Move
()
{
if
(
Input
.
GetMouseButtonUp
(
0
))
{
isInit_move
=
false
;
if
(
MoveEnd
Flag
&&
!
IsPlayAniFlag
)
if
(
CanPlayLerp
Flag
&&
!
IsPlayAniFlag
)
LerptoMove_End
();
clickTime
=
0
;
}
...
...
@@ -181,6 +182,7 @@ public class ScaleToImage : MonoBehaviour
{
MoveEndFlag
=
true
;
nowmoustpos
=
Input
.
mousePosition
;
startmoustpos
=
nowmoustpos
;
}
else
{
...
...
@@ -190,16 +192,15 @@ public class ScaleToImage : MonoBehaviour
if
(
Input
.
GetMouseButton
(
0
))
{
clickTime
+=
Time
.
deltaTime
;
oldmoustpos
=
nowmoustpos
;
nowmoustpos
=
Input
.
mousePosition
;
if
(
MoveEndFlag
&&
clickTime
>=
0.1f
)
if
(
MoveEndFlag
&&
(
clickTime
>=
0.1f
||
Vector3
.
Distance
(
startmoustpos
,
nowmoustpos
)>=
200
)
)
{
OnClickMove
(
nowmoustpos
);
}
}
}
private
Vector3
old
moustpos
;
private
Vector3
start
moustpos
;
private
Vector3
nowmoustpos
;
private
void
LerptoMove_End
()
//移动结束后加个缓动的效果
{
...
...
@@ -223,6 +224,7 @@ public class ScaleToImage : MonoBehaviour
var
item
=
target
.
GetChild
(
i
);
item
.
DOMove
(
newpos
,
0.3f
);
}
CanPlayLerpFlag
=
false
;
}
}
...
...
@@ -244,6 +246,11 @@ public class ScaleToImage : MonoBehaviour
pos
=
new
Vector3
(
x
,
y
,
0
);
OldPos_Move
=
new
Vector3
(
target
.
GetChild
(
0
).
position
.
x
,
target
.
GetChild
(
0
).
position
.
y
,
0
);
if
(
OldPos_Move
==
pos
)
{
return
;
}
CanPlayLerpFlag
=
true
;
for
(
int
i
=
0
;
i
<
target
.
childCount
;
i
++)
{
var
item
=
target
.
GetChild
(
i
);
...
...
Assets/scripts/Views/gameScene/gameSceneLogic.cs
View file @
aee5d078
...
...
@@ -168,6 +168,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
item
.
GID
=
group
.
gid
;
item
.
UseColor
=
group
.
rgb
;
item
.
NowProgress
=
group
.
Jindu
;
if
(
lvbType
==
ListViewBackTypeEnum
.
create
||
isSelect
!=
oldIsSelect
)
{
...
...
@@ -226,6 +227,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
item
.
IsSelect
=
false
;
item
.
switchPlayAnimation
();
}
int
idx
=
(
int
)
objects
[
0
];
oldindex
=
nowidx
;
nowidx
=
idx
;
...
...
@@ -233,12 +235,12 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
item
=
gridViewList
.
getObjectById
(
idx
).
GetComponent
<
colorItem
>();
item
.
IsSelect
=
true
;
item
.
switchPlayAnimation
();
maingameView
.
switchShowAreaGroup
((
short
)
nowSelectGroupId
,
(
int
id
,
bool
isOk
)
=>
{
if
(
isOk
)
{
transform
.
Find
(
"areaGroupList/tipSelectGroup"
).
gameObject
.
SetActive
(
false
);
}
});
//
maingameView.switchShowAreaGroup((short)nowSelectGroupId, (int id, bool isOk) => {
//
if (isOk)
//
{
//
transform.Find("areaGroupList/tipSelectGroup").gameObject.SetActive(false);
//
}
//
});
Transform
item_obj
;
Transform
ItemParent
=
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>().
content
;
...
...
@@ -264,7 +266,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
if
(
targetpos
>
ItemParent
.
localPosition
.
x
)
{
ItemParent
.
DOLocalMoveX
(
targetpos
,
1f
);
return
;
}
}
...
...
@@ -282,7 +283,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
IEnumerator
DelayToRefreshGrid
()
{
yield
return
new
WaitForSeconds
(
0.
3
f
);
yield
return
new
WaitForSeconds
(
0.
2
f
);
Transform
ItemParent
=
areaGroupList
.
transform
.
GetComponent
<
ScrollRect
>().
content
;
int
itemNum
=
ItemParent
.
childCount
;
Transform
item
;
...
...
Assets/scripts/common/mainGameScaleMove.cs
View file @
aee5d078
...
...
@@ -143,7 +143,6 @@ public class mainGameScaleMove : MonoBehaviour
}
else
if
(
Input
.
touchCount
==
1
)
{
return
;
var
oneTouch
=
Input
.
GetTouch
(
0
);
TouchPhase
touchPhase
=
oneTouch
.
phase
;
if
(
touchPhase
==
TouchPhase
.
Began
)
...
...
Assets/scripts/common/mainGameView.cs
View file @
aee5d078
...
...
@@ -1438,6 +1438,18 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
}
return
true
;
},
0.8
,
10
);
StartCoroutine
(
Delay
());
}
IEnumerator
Delay
()
{
yield
return
new
WaitForSeconds
(
10.2f
);
if
(
utilsTools
.
getGDataByKey
<
bool
>(
EventName
.
DataName
.
Data_autoFillColor
,
false
))
{
utilsTools
.
setGDataByKey
(
EventName
.
DataName
.
Data_enableZoomMove
,
true
);
utilsTools
.
setGDataByKey
(
EventName
.
DataName
.
Data_autoFillColor
,
false
);
}
}
//提示的查找过程
public
void
onTipHandler
()
...
...
Assets/scripts/perfabItems/colorItem.cs
View file @
aee5d078
...
...
@@ -5,9 +5,10 @@ using System.Collections.Generic;
using
TMPro
;
using
Unity.VisualScripting
;
using
UnityEngine
;
using
UnityEngine.EventSystems
;
using
UnityEngine.UI
;
public
class
colorItem
:
MonoBehaviour
public
class
colorItem
:
MonoBehaviour
,
IPointerDownHandler
,
IPointerUpHandler
{
[
SerializeField
]
private
bool
isSelect
=
false
;
...
...
@@ -24,6 +25,12 @@ public class colorItem : MonoBehaviour
public
Image
Image_Jindu
;
private
int
gID
;
public
float
SelectScale
;
//选中的缩放大小
public
float
NotSelectScale
;
//没选中的缩放大小
public
float
SelectAniScale
;
//选中的动画最大缩放
public
float
SelectButtonDownScale
;
//选中的按钮按下缩放大小
public
float
NotSelectButtonDownScale
;
//没选中的按钮按下的缩放大小
public
int
GID
//组ID
{
get
{
return
gID
;
}
...
...
@@ -63,17 +70,22 @@ public class colorItem : MonoBehaviour
}
public
void
PlayInitAni
()
{
transform
.
DOScale
(
Vector3
.
one
*
0.95f
,
0.3f
).
onComplete
=()=>
{
transform
.
DOScale
(
Vector3
.
one
*
0.8f
,
0.2f
);
};
transform
.
DOScale
(
Vector3
.
one
*
SelectAniScale
,
0.3f
).
onComplete
=()=>
{
transform
.
DOScale
(
Vector3
.
one
*
NotSelectScale
,
0.2f
);
};
}
public
void
switchPlayAnimation
()
{
if
(
isSelect
)
{
transform
.
DOScale
(
Vector3
.
one
*
0.95f
,
0.5f
).
onComplete
=()=>
{
CanPlayAniFlag
=
true
;
};
transform
.
DOScale
(
Vector3
.
one
*
SelectAniScale
,
0.2f
).
SetEase
(
Ease
.
OutSine
).
onComplete
=
()
=>
{
CanPlayAniFlag
=
true
;
transform
.
DOScale
(
Vector3
.
one
*
SelectScale
,
0.1f
);
};
}
else
{
transform
.
DOScale
(
Vector3
.
one
*
0.8f
,
0.5f
).
onComplete
=
()
=>
{
CanPlayAniFlag
=
false
;
};
;
transform
.
DOScale
(
Vector3
.
one
*
NotSelectScale
,
0.2f
).
SetEase
(
Ease
.
OutSine
).
onComplete
=
()
=>
{
CanPlayAniFlag
=
false
;
}
;
}
}
...
...
@@ -202,12 +214,13 @@ public class colorItem : MonoBehaviour
}
}
public
void
CreateMat
()
{
mat
=
Image_Jindu
.
material
;
mat
=
Instantiate
(
mat
);
Image_Jindu
.
material
=
mat
;
transform
.
localScale
=
Vector3
.
one
*
0.8f
;
transform
.
localScale
=
Vector3
.
one
*
NotSelectScale
;
}
public
bool
isFinish
()
...
...
@@ -216,17 +229,15 @@ public class colorItem : MonoBehaviour
}
public
void
onClickAreaGroup
()
{
if
(
IsSelect
)
{
return
;
}
//if (isSelect == false && isFinish() == false)
{
if
(
utilsTools
.
getGDataByKey
<
bool
>(
EventName
.
DataName
.
Data_autoFillColor
,
false
))
return
;
utilsTools
.
sendEventObjectParams
(
EventName
.
Event
.
Event_switchGameAreaGroupId
,
index
);
}
if
(
CanPlayAniFlag
)
{
var
nowscale
=
transform
.
localScale
;
transform
.
DOScale
(
transform
.
localScale
*
0.9f
,
0.1f
).
onComplete
=
()
=>
{
transform
.
DOScale
(
nowscale
,
0.1f
);
};
}
}
public
void
SetLocalRootPos
()
//保存一下第一个的原始坐标
...
...
@@ -243,12 +254,12 @@ public class colorItem : MonoBehaviour
//if (clickindex - 1 > index)
// return;
//transform.DOLocalMoveX(clickpos - 120 * (clickindex - index) - 5, 0.5f);
transform
.
DOLocalMoveX
(
LocalPos_Root
.
x
+
index
*
Size
,
0.
3
f
);
transform
.
DOLocalMoveX
(
LocalPos_Root
.
x
+
index
*
Size
,
0.
2
f
);
}
else
{
transform
.
DOLocalMoveX
(
clickpos
+
Size
*
(
index
-
clickindex
)
+
offset_dis
,
0.
3
f
);
transform
.
DOLocalMoveX
(
clickpos
+
Size
*
(
index
-
clickindex
)
+
offset_dis
,
0.
2
f
);
//transform.DOLocalMoveX(LocalPos_Root.x + 120 * index + offset_dis, 0.5f);
}
}
...
...
@@ -258,4 +269,19 @@ public class colorItem : MonoBehaviour
transform
.
DOLocalMoveX
(
LocalPos_Root
.
x
+
index
*
Size
,
0.1f
);
}
public
void
OnPointerDown
(
PointerEventData
eventData
)
{
if
(
IsSelect
)
transform
.
DOScale
(
SelectButtonDownScale
,
0.2f
);
else
transform
.
DOScale
(
NotSelectButtonDownScale
,
0.2f
);
}
public
void
OnPointerUp
(
PointerEventData
eventData
)
{
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