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
20711c61
Commit
20711c61
authored
Aug 24, 2023
by
JiangWanZhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
替换组里面波浪效果的图、加个鼠标滚轮缩放
parent
cddac77d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
13850 deletions
+101
-13850
圆.png
Assets/Art/GameEnd/圆.png
+0
-0
圆.png.meta
Assets/Art/GameEnd/圆.png.meta
+1
-1
gameAreaGroupItem.prefab
Assets/Resources/perfabs/gameAreaGroupItem.prefab
+2
-2
AotStubs.cs
...isualScripting.Generated/VisualScripting.Core/AotStubs.cs
+0
-13790
AotStubs.cs.meta
...Scripting.Generated/VisualScripting.Core/AotStubs.cs.meta
+0
-11
ScaleToImage.cs
Assets/scripts/ScaleToImage.cs
+98
-46
No files found.
Assets/Art/GameEnd/圆.png
View replaced file @
cddac77d
View file @
20711c61
7.47 KB
|
W:
|
H:
3.38 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Assets/Art/GameEnd/圆.png.meta
View file @
20711c61
fileFormatVersion: 2
guid:
f3a23023775d5604cbae05a554da8bce
guid:
113fcf756ed6dfe4da29639c7600ef7a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
...
...
Assets/Resources/perfabs/gameAreaGroupItem.prefab
View file @
20711c61
...
...
@@ -67,7 +67,7 @@ MonoBehaviour:
m_OnCullStateChanged
:
m_PersistentCalls
:
m_Calls
:
[]
m_Texture
:
{
fileID
:
2800000
,
guid
:
f3a23023775d5604cbae05a554da8bce
,
type
:
3
}
m_Texture
:
{
fileID
:
2800000
,
guid
:
113fcf756ed6dfe4da29639c7600ef7a
,
type
:
3
}
m_UVRect
:
serializedVersion
:
2
x
:
0
...
...
@@ -567,7 +567,7 @@ MonoBehaviour:
m_OnCullStateChanged
:
m_PersistentCalls
:
m_Calls
:
[]
m_Sprite
:
{
fileID
:
21300000
,
guid
:
f3a23023775d5604cbae05a554da8bce
,
type
:
3
}
m_Sprite
:
{
fileID
:
21300000
,
guid
:
113fcf756ed6dfe4da29639c7600ef7a
,
type
:
3
}
m_Type
:
3
m_PreserveAspect
:
0
m_FillCenter
:
1
...
...
Assets/Unity.VisualScripting.Generated/VisualScripting.Core/AotStubs.cs
deleted
100644 → 0
View file @
cddac77d
This diff is collapsed.
Click to expand it.
Assets/Unity.VisualScripting.Generated/VisualScripting.Core/AotStubs.cs.meta
deleted
100644 → 0
View file @
cddac77d
fileFormatVersion: 2
guid: f9972d7e7139d5f43bef9238e8d9dcad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/scripts/ScaleToImage.cs
View file @
20711c61
...
...
@@ -45,7 +45,7 @@ public class ScaleToImage : MonoBehaviour
private
Vector3
OnInitPos
;
private
void
Start
()
{
canvasCamera
=
transform
.
parent
.
GetComponent
<
ScaleToImage
>().
canvasCamera
;
canvasCamera
=
transform
.
parent
.
GetComponent
<
ScaleToImage
>().
canvasCamera
;
RegisterEvent
(
true
);
StartCoroutine
(
Delay
());
...
...
@@ -64,7 +64,7 @@ public class ScaleToImage : MonoBehaviour
private
void
ResetPos_Scale
(
object
[]
values
)
{
target
.
localScale
=
OnInitScale
;
target
.
localScale
=
OnInitScale
;
target
.
position
=
OnInitPos
;
...
...
@@ -74,6 +74,10 @@ public class ScaleToImage : MonoBehaviour
private
void
Update
()
{
#if UNITY_EDITOR
Editor_Scale
();
return
;
#endif
if
(
Input
.
touchCount
==
2
)
{
Scale
();
...
...
@@ -129,65 +133,54 @@ public class ScaleToImage : MonoBehaviour
}
}
private
void
RefreshScrollview
()
{
target
.
gameObject
.
SetActive
(
false
);
target
.
gameObject
.
SetActive
(
true
);
scrollRect
.
inertia
=
true
;
}
private
void
StopScaleToSetSize
()
{
if
(
ScaleSize_List
.
Count
>
0
)
{
ChangeFontSize
(
ScaleSize_List
[
ScaleSize_List
.
Count
-
1
]);
ScaleSize_List
.
Clear
();
}
}
private
void
ChangeFontSize
(
float
scalesize
)
private
void
Editor_Scale
()
{
GameMgr
.
Ins
.
tiMgr
.
SizeChange
(
scalesize
);
}
private
void
Scale
()
{
if
(!
isInit_Scale
)
var
mouse
=
Input
.
GetAxis
(
"Mouse ScrollWheel"
);
if
(
mouse
!=
0
)
//向前,该放大
{
SetscrollRectEnable
(
false
);
//两指点位
touch1
=
canvasCamera
.
ScreenToWorldPoint
(
Input
.
GetTouch
(
0
).
position
);
touch2
=
canvasCamera
.
ScreenToWorldPoint
(
Input
.
GetTouch
(
1
).
position
);
touch1
=
new
Vector3
(
touch1
.
x
,
touch1
.
y
,
0
);
touch2
=
new
Vector3
(
touch2
.
x
,
touch2
.
y
,
0
);
var
mouseposition
=
Input
.
mousePosition
;
pos
=
canvasCamera
.
ScreenToWorldPoint
(
mouseposition
);
pos
=
new
Vector3
(
pos
.
x
,
pos
.
y
,
0
);
//图片的初始点位
oriPos
=
new
Vector3
(
target
.
position
.
x
,
target
.
position
.
y
,
0
);
float
distance
=
Vector2
.
Distance
(
touch1
,
touch2
)
/
2f
;
var
normal
=
(
touch1
-
touch2
).
normalized
;
pos
=
normal
*
distance
+
touch2
;
//两个手指中间的点
//指向手指中心的单位向量
//指向中心的单位向量
ToFigerCenter
=
(
pos
-
oriPos
).
normalized
;
//距离
ToFigerdistance
=
Vector3
.
Distance
(
pos
,
oriPos
);
oriScale
=
target
.
localScale
.
x
;
//开始的缩放值
isInit_Scale
=
true
;
MoveValue
=
1
/
oriScale
;
SatrtScale
=
target
.
localScale
.
x
;
StartPos
=
target
.
position
;
return
;
scale
=
mouse
;
bool
isBig
=
scale
>
0
;
float
scale_target
=
0
;
//控制缩放速度
scale
=
scale
*
scaleSpeed
;
//正的话就是放大图片
OnScale
(
scale_target
,
isBig
);
delaytime
=
0
;
RefreshScrollview
();
}
else
{
if
(
delaytime
>=
0.5f
&&
!
scrollRect
.
enabled
)
{
SetscrollRectEnable
(
true
);
}
else
{
delaytime
+=
Time
.
deltaTime
;
}
}
}
//两指缩放比例
float
nowdis
=
Vector3
.
Distance
(
canvasCamera
.
ScreenToWorldPoint
(
Input
.
GetTouch
(
0
).
position
),
canvasCamera
.
ScreenToWorldPoint
(
Input
.
GetTouch
(
1
).
position
));
scale
=
nowdis
/
Vector3
.
Distance
(
touch1
,
touch2
);
//大于1是放大,小于是缩小
bool
isBig
=
scale
>
1
;
float
scale_target
=
0
;
//控制缩放速度
scale
=
(
scale
-
1
)
*
scaleSpeed
;
//正的话就是放大图片
float
delaytime
=
0
;
private
void
OnScale
(
float
scale_target
,
bool
isBig
)
{
if
(
scale
<
0
)
{
scale
=
scale
*
oriScale
*
scaleSpeed
;
//缩小速度
...
...
@@ -252,7 +245,66 @@ public class ScaleToImage : MonoBehaviour
ScaleSize_List
.
Clear
();
ChangeFontSize
(
NowScale
);
}
}
private
void
RefreshScrollview
()
{
target
.
gameObject
.
SetActive
(
false
);
target
.
gameObject
.
SetActive
(
true
);
scrollRect
.
inertia
=
true
;
}
private
void
StopScaleToSetSize
()
{
if
(
ScaleSize_List
.
Count
>
0
)
{
ChangeFontSize
(
ScaleSize_List
[
ScaleSize_List
.
Count
-
1
]);
ScaleSize_List
.
Clear
();
}
}
private
void
ChangeFontSize
(
float
scalesize
)
{
GameMgr
.
Ins
.
tiMgr
.
SizeChange
(
scalesize
);
}
private
void
Scale
()
{
if
(!
isInit_Scale
)
{
SetscrollRectEnable
(
false
);
//两指点位
touch1
=
canvasCamera
.
ScreenToWorldPoint
(
Input
.
GetTouch
(
0
).
position
);
touch2
=
canvasCamera
.
ScreenToWorldPoint
(
Input
.
GetTouch
(
1
).
position
);
touch1
=
new
Vector3
(
touch1
.
x
,
touch1
.
y
,
0
);
touch2
=
new
Vector3
(
touch2
.
x
,
touch2
.
y
,
0
);
//图片的初始点位
oriPos
=
new
Vector3
(
target
.
position
.
x
,
target
.
position
.
y
,
0
);
float
distance
=
Vector2
.
Distance
(
touch1
,
touch2
)
/
2f
;
var
normal
=
(
touch1
-
touch2
).
normalized
;
pos
=
normal
*
distance
+
touch2
;
//两个手指中间的点
//指向手指中心的单位向量
ToFigerCenter
=
(
pos
-
oriPos
).
normalized
;
//距离
ToFigerdistance
=
Vector3
.
Distance
(
pos
,
oriPos
);
oriScale
=
target
.
localScale
.
x
;
//开始的缩放值
isInit_Scale
=
true
;
MoveValue
=
1
/
oriScale
;
SatrtScale
=
target
.
localScale
.
x
;
StartPos
=
target
.
position
;
return
;
}
//两指缩放比例
float
nowdis
=
Vector3
.
Distance
(
canvasCamera
.
ScreenToWorldPoint
(
Input
.
GetTouch
(
0
).
position
),
canvasCamera
.
ScreenToWorldPoint
(
Input
.
GetTouch
(
1
).
position
));
scale
=
nowdis
/
Vector3
.
Distance
(
touch1
,
touch2
);
//大于1是放大,小于是缩小
bool
isBig
=
scale
>
1
;
float
scale_target
=
0
;
OnScale
(
scale_target
,
isBig
);
}
private
void
SetscrollRectEnable
(
bool
enable
)
...
...
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