Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SteelBall
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanqing
SteelBall
Commits
1dca60ae
Commit
1dca60ae
authored
Jan 27, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后续需求优化
parent
6e16b620
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
302 additions
and
19 deletions
+302
-19
.suo
SteelBall/.vs/SteelBall/v16/.suo
+0
-0
SixLevelPlayerCollision.cs
...s/0A2_Scripts/Battle/Collision/SixLevelPlayerCollision.cs
+1
-1
ChainHandle.cs
SteelBall/Assets/0A2_Scripts/Battle/View/ChainHandle.cs
+14
-3
BattleUI.prefab
SteelBall/Assets/0A3_Prefabs/BattleUI.prefab
+1
-1
Level06.prefab
SteelBall/Assets/Res/Prefabs/Levels/Level06.prefab
+286
-14
No files found.
SteelBall/.vs/SteelBall/v16/.suo
View file @
1dca60ae
No preview for this file type
SteelBall/Assets/0A2_Scripts/Battle/Collision/SixLevelPlayerCollision.cs
View file @
1dca60ae
...
@@ -8,7 +8,7 @@ public class SixLevelPlayerCollision : MonoBehaviour
...
@@ -8,7 +8,7 @@ public class SixLevelPlayerCollision : MonoBehaviour
private
bool
m_bCollider
=
true
;
private
bool
m_bCollider
=
true
;
private
bool
m_bControlWin
=
true
;
private
bool
m_bControlWin
=
true
;
private
Animator
m_animator
;
private
Animator
m_animator
;
private
float
m_moveSpeed
=
1
.0f
;
private
float
m_moveSpeed
=
2
.0f
;
private
float
m_minHeight
=
-
2.0f
;
private
float
m_minHeight
=
-
2.0f
;
private
float
m_targetX
=
1.06f
;
private
float
m_targetX
=
1.06f
;
private
float
m_tartgetY
=
2.0f
;
private
float
m_tartgetY
=
2.0f
;
...
...
SteelBall/Assets/0A2_Scripts/Battle/View/ChainHandle.cs
View file @
1dca60ae
...
@@ -18,6 +18,7 @@ public class ChainHandle : MonoBehaviour
...
@@ -18,6 +18,7 @@ public class ChainHandle : MonoBehaviour
private
Vector3
m_maxHeightBallPos
=
new
Vector3
(
2.075f
,
3.0f
,
-
6.5f
);
//铁球最大高度
private
Vector3
m_maxHeightBallPos
=
new
Vector3
(
2.075f
,
3.0f
,
-
6.5f
);
//铁球最大高度
private
Transform
m_parentTrans
;
//父节点
private
Transform
m_parentTrans
;
//父节点
private
HingeJoint
m_hingJoint
;
private
HingeJoint
m_hingJoint
;
private
bool
m_controlRotate
=
true
;
//控制旋转
// Start is called before the first frame update
// Start is called before the first frame update
private
void
Awake
()
private
void
Awake
()
{
{
...
@@ -196,6 +197,13 @@ public class ChainHandle : MonoBehaviour
...
@@ -196,6 +197,13 @@ public class ChainHandle : MonoBehaviour
// m_topColliderPosY,
// m_topColliderPosY,
// Mathf.Clamp(transform.position.z, varMinY, varMaxY));
// Mathf.Clamp(transform.position.z, varMinY, varMaxY));
//}
//}
//铁球有去无回
if
(
transform
.
localEulerAngles
.
x
>
180.0f
&&
transform
.
localEulerAngles
.
x
<=
330.0f
&&
m_controlRotate
)
{
m_controlRotate
=
false
;
m_rigidBody
.
isKinematic
=
true
;
transform
.
localRotation
=
Quaternion
.
Euler
(-
90
,
0
,
0
);
}
}
}
void
Clicked
()
void
Clicked
()
...
@@ -206,13 +214,13 @@ public class ChainHandle : MonoBehaviour
...
@@ -206,13 +214,13 @@ public class ChainHandle : MonoBehaviour
if
(
Physics
.
Raycast
(
ray
,
out
hit
))
if
(
Physics
.
Raycast
(
ray
,
out
hit
))
{
{
if
(
hit
.
collider
.
gameObject
.
CompareTag
(
"Target"
))
if
(
hit
.
collider
&&
hit
.
collider
.
gameObject
.
CompareTag
(
"Target"
))
{
{
//十字架位置
//十字架位置
float
varX
=
(
Input
.
mousePosition
.
x
-
Screen
.
width
/
2f
)
/
(
Screen
.
width
/
GlobalConfig
.
NormalWidth
);
float
varX
=
(
Input
.
mousePosition
.
x
-
Screen
.
width
/
2f
)
/
(
Screen
.
width
/
GlobalConfig
.
NormalWidth
);
float
varY
=
(
Input
.
mousePosition
.
y
-
Screen
.
height
/
2f
)
/
(
Screen
.
width
/
GlobalConfig
.
NormalWidth
);
float
varY
=
(
Input
.
mousePosition
.
y
-
Screen
.
height
/
2f
)
/
(
Screen
.
width
/
GlobalConfig
.
NormalWidth
);
BattleCtrl
.
instance
.
battleUI
.
SetSymbolPos
(
varX
,
varY
);
BattleCtrl
.
instance
.
battleUI
.
SetSymbolPos
(
varX
,
varY
);
//
设置铁球位置
//
重置状态
m_rigidBody
.
isKinematic
=
true
;
m_rigidBody
.
isKinematic
=
true
;
if
(
m_hingJoint
)
if
(
m_hingJoint
)
{
{
...
@@ -220,9 +228,12 @@ public class ChainHandle : MonoBehaviour
...
@@ -220,9 +228,12 @@ public class ChainHandle : MonoBehaviour
m_hingJoint
=
null
;
m_hingJoint
=
null
;
}
}
transform
.
localRotation
=
Quaternion
.
Euler
(
60
,
0
,
0
);
transform
.
localRotation
=
Quaternion
.
Euler
(
60
,
0
,
0
);
m_controlRotate
=
true
;
//设置铁球位置
Vector3
varVec3
=
m_parentTrans
.
position
;
Vector3
varVec3
=
m_parentTrans
.
position
;
varVec3
.
x
=
hit
.
point
.
x
-
m_maxHeightBallPos
.
x
;
varVec3
.
x
=
hit
.
point
.
x
-
m_maxHeightBallPos
.
x
;
varVec3
.
y
=
hit
.
point
.
y
+
6.0
f
;
varVec3
.
y
=
hit
.
point
.
y
+
5.2
f
;
varVec3
.
z
=
0
;
varVec3
.
z
=
0
;
m_parentTrans
.
position
=
varVec3
;
m_parentTrans
.
position
=
varVec3
;
GameServices
.
timerServices
.
Push
(
this
,
0.1f
,
delegate
GameServices
.
timerServices
.
Push
(
this
,
0.1f
,
delegate
...
...
SteelBall/Assets/0A3_Prefabs/BattleUI.prefab
View file @
1dca60ae
...
@@ -142,7 +142,7 @@ RectTransform:
...
@@ -142,7 +142,7 @@ RectTransform:
m_GameObject
:
{
fileID
:
634235204
}
m_GameObject
:
{
fileID
:
634235204
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
0.
3
,
y
:
0.3
,
z
:
1
}
m_LocalScale
:
{
x
:
0.
5
,
y
:
0.5
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
6064464677632144690
}
m_Father
:
{
fileID
:
6064464677632144690
}
m_RootOrder
:
14
m_RootOrder
:
14
...
...
SteelBall/Assets/Res/Prefabs/Levels/Level06.prefab
View file @
1dca60ae
This diff is collapsed.
Click to expand it.
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