Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Storage
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
Storage
Commits
5f1608c0
Commit
5f1608c0
authored
Apr 06, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化碰撞
parent
28f02e4a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
39 deletions
+56
-39
TargetCollision.cs
...ge/Assets/#A2_Scripts/Battle/Collision/TargetCollision.cs
+5
-0
StorageView.cs
Storage/Assets/#A2_Scripts/Battle/View/StorageView.cs
+25
-16
GlobalConfig.cs
Storage/Assets/#A2_Scripts/Services/GlobalConfig.cs
+6
-3
Level1.prefab
Storage/Assets/Res/Levels/Level1.prefab
+5
-5
Level2.prefab
Storage/Assets/Res/Levels/Level2.prefab
+6
-6
Level3.prefab
Storage/Assets/Res/Levels/Level3.prefab
+5
-5
Level4.prefab
Storage/Assets/Res/Levels/Level4.prefab
+2
-2
Level5.prefab
Storage/Assets/Res/Levels/Level5.prefab
+2
-2
No files found.
Storage/Assets/#A2_Scripts/Battle/Collision/TargetCollision.cs
View file @
5f1608c0
...
...
@@ -17,6 +17,11 @@ public class TargetCollision : MonoBehaviour
m_bControl
=
false
;
varView
.
SetTargetCollison
(
other
.
collider
.
transform
,
true
);
}
Rigidbody
varBody
=
GetComponent
<
Rigidbody
>();
if
(
varBody
&&
varView
&&
varView
.
IsHitTarget
)
{
varBody
.
velocity
=
Vector3
.
zero
;
}
}
}
private
void
OnCollisionExit
(
Collision
other
)
...
...
Storage/Assets/#A2_Scripts/Battle/View/StorageView.cs
View file @
5f1608c0
...
...
@@ -34,6 +34,7 @@ public class StorageView : MonoBehaviour
private
float
m_bottomHeight
=
0.25f
;
//底部高度
private
Camera
m_camera
;
private
bool
m_bIsHitTarget
=
false
;
public
bool
IsHitTarget
=>
m_bIsHitTarget
;
private
float
m_curTargetPosY
=
0.0f
;
//当前抓的目标位置Y
private
float
m_modelCompassTopPosY
=
1.18f
;
//指南针//0.2
private
float
m_modelBinocularTopPosY
=
1.17f
;
//望远镜//0.44
...
...
@@ -371,9 +372,9 @@ public class StorageView : MonoBehaviour
m_curTargetTrans
.
transform
.
position
=
Camera
.
main
.
ScreenToWorldPoint
(
new
Vector3
(
Input
.
mousePosition
.
x
,
Input
.
mousePosition
.
y
,
m_targetScreenVec
.
z
));
//十字架位置
float
varX
=
(
Input
.
mousePosition
.
x
-
Screen
.
width
/
2f
)
/
(
Screen
.
width
/
GlobalConfig
.
NormalWidth
);
float
varY
=
(
Input
.
mousePosition
.
y
-
Screen
.
height
/
2f
)
/
(
Screen
.
width
/
GlobalConfig
.
NormalWidth
);
BattleCtrl
.
instance
.
battleUI
.
SetSymbolPos
(
varX
,
varY
);
//
float varX = (Input.mousePosition.x - Screen.width / 2f) / (Screen.width / GlobalConfig.NormalWidth);
//
float varY = (Input.mousePosition.y - Screen.height / 2f) / (Screen.width / GlobalConfig.NormalWidth);
//
BattleCtrl.instance.battleUI.SetSymbolPos(varX, varY);
//if(string.Equals(m_curTargetTrans.name, m_modelBallStr))
//{
// m_curTargetTrans.transform.localScale = Vector3.Lerp(m_curTargetTrans.transform.localScale, Vector3.one * 4, 0.2f);
...
...
@@ -439,17 +440,17 @@ public class StorageView : MonoBehaviour
}
m_curTargetTrans
.
transform
.
position
=
varPos
;
}
if
(
m_bIsHitTarget
)
{
m_bIsHitTarget
=
false
;
if
(
m_animator
)
{
m_animator
.
enabled
=
true
;
}
Invoke
(
"SetTargetParent"
,
1.0f
);
//m_camera.transform.position = Vector3.Lerp(m_camera.transform.position, m_cameraTargetPos, 0.2f);
//m_camera.transform.rotation = Quaternion.Lerp(m_camera.transform.rotation, m_cameraTargetRotate, 0.2f);
}
//
if (m_bIsHitTarget)
//
{
//
m_bIsHitTarget = false;
//
if (m_animator)
//
{
//
m_animator.enabled = true;
//
}
//
Invoke("SetTargetParent", 1.0f);
//
//m_camera.transform.position = Vector3.Lerp(m_camera.transform.position, m_cameraTargetPos, 0.2f);
//
//m_camera.transform.rotation = Quaternion.Lerp(m_camera.transform.rotation, m_cameraTargetRotate, 0.2f);
//
}
if
(
m_bResult
)
{
for
(
int
i
=
0
;
i
<
m_targetTrans
.
Length
;
i
++)
...
...
@@ -499,7 +500,7 @@ public class StorageView : MonoBehaviour
}
m_collisonTargetTrans
=
null
;
m_bIsCollisonTarget
=
false
;
BattleCtrl
.
instance
.
battleUI
.
SetSymbolPos
(
0
,
0
);
//
BattleCtrl.instance.battleUI.SetSymbolPos(0, 0);
//CancelDelayMatChangeHandle();
//Invoke("DelayMatChangeHandle", 0.5f);
CancelRotateInvoke
();
...
...
@@ -588,7 +589,15 @@ public class StorageView : MonoBehaviour
{
if
(
hit
.
collider
&&
hit
.
collider
.
gameObject
.
CompareTag
(
"Target"
))
{
m_bIsHitTarget
=
true
;
if
(!
m_bIsHitTarget
)
{
m_bIsHitTarget
=
true
;
if
(
m_animator
)
{
m_animator
.
enabled
=
true
;
}
Invoke
(
"SetTargetParent"
,
1.0f
);
}
//for (int i = 0; i < m_targetTrans.Length; i++)
//{
// m_targetTrans[i].GetComponent<Rigidbody>().isKinematic = true;
...
...
Storage/Assets/#A2_Scripts/Services/GlobalConfig.cs
View file @
5f1608c0
...
...
@@ -66,15 +66,18 @@ public class GlobalConfig
{
int
varLevel
=
BattleCtrl
.
instance
.
levelManager
.
CurLevelIndex
;
float
varHeight
=
0
;
if
(
varLevel
==
LevelEnum
.
levelOneIndex
||
varLevel
==
LevelEnum
.
levelFourIndex
||
varLevel
==
LevelEnum
.
levelFiveIndex
if
(
varLevel
==
LevelEnum
.
levelOneIndex
)
{
varHeight
=
1.5f
;
}
else
if
(
varLevel
==
LevelEnum
.
levelFourIndex
||
varLevel
==
LevelEnum
.
levelFiveIndex
||
varLevel
==
LevelEnum
.
levelSevenIndex
)
{
varHeight
=
1.1f
;
}
else
if
(
varLevel
==
LevelEnum
.
levelTwoIndex
||
varLevel
==
LevelEnum
.
levelThreeIndex
)
{
varHeight
=
1.
6
f
;
varHeight
=
1.
9
f
;
}
else
if
(
varLevel
==
LevelEnum
.
levelSixIndex
)
{
...
...
Storage/Assets/Res/Levels/Level1.prefab
View file @
5f1608c0
...
...
@@ -311,7 +311,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 90189418590942544}
m_LocalRotation: {x: -0.6593273, y: -0.25551423, z: -0.2555143, w: 0.65932727}
m_LocalPosition: {x: 0.84, y:
-0.33
, z: -3.84}
m_LocalPosition: {x: 0.84, y:
0.48
, z: -3.84}
m_LocalScale: {x: 30, y: 30, z: 30}
m_Children: []
m_Father: {fileID: 6381050228751430806}
...
...
@@ -5434,7 +5434,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 975760145897770363}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.47, z: -1}
m_LocalPosition: {x: 0, y: 1.47, z: -1
.77
}
m_LocalScale: {x: 2.5, y: 0.01, z: 2.5}
m_Children: []
m_Father: {fileID: 6686058080312210682}
...
...
@@ -7369,7 +7369,7 @@ MonoBehaviour:
cachedMesh: {fileID: -5597002278806442958, guid: ec6fdbeb5268e694fb33a095e6f252b3,
type: 3}
InvisibleUpdate: 0
readable:
1
readable:
0
--- !u!1 &1875882243473469678
GameObject:
m_ObjectHideFlags: 0
...
...
@@ -58556,7 +58556,7 @@ MonoBehaviour:
cachedMesh: {fileID: 8321685774571456786, guid: ec6fdbeb5268e694fb33a095e6f252b3,
type: 3}
InvisibleUpdate: 0
readable:
1
readable:
0
--- !u!1 &6404169673511446009
GameObject:
m_ObjectHideFlags: 0
...
...
@@ -63788,7 +63788,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7803985779353112106}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.43, z: -1.
02
}
m_LocalPosition: {x: 0, y: 0.43, z: -1.
77
}
m_LocalScale: {x: 3, y: 1.5, z: 3}
m_Children: []
m_Father: {fileID: 6686058080312210682}
Storage/Assets/Res/Levels/Level2.prefab
View file @
5f1608c0
...
...
@@ -16932,7 +16932,7 @@ MonoBehaviour:
cachedMesh: {fileID: 1044666760486720641, guid: 188a7f6966cec7d44b52b5c344f37345,
type: 3}
InvisibleUpdate: 0
readable:
1
readable:
0
--- !u!114 &8805164226647202219
MonoBehaviour:
m_ObjectHideFlags: 0
...
...
@@ -41857,7 +41857,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4313810224392433900}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -0.
1
, z: 0}
m_LocalPosition: {x: 0, y: -0.
2
, z: 0}
m_LocalScale: {x: 100, y: 1, z: 100}
m_Children: []
m_Father: {fileID: 8827868373483138479}
...
...
@@ -92504,7 +92504,7 @@ MonoBehaviour:
cachedMesh: {fileID: -7011429734207973542, guid: 188a7f6966cec7d44b52b5c344f37345,
type: 3}
InvisibleUpdate: 0
readable:
1
readable:
0
--- !u!114 &353385722379460216
MonoBehaviour:
m_ObjectHideFlags: 0
...
...
@@ -109630,13 +109630,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8991654502457839963}
m_LocalRotation: {x: -0
, y: -0, z: -0, w:
1}
m_LocalRotation: {x: -0
.06975647, y: 0, z: 0, w: 0.997564
1}
m_LocalPosition: {x: 0, y: 0.5094759, z: -0.1588525}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6461549933381941209}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x:
0
, y: 0, z: 0}
m_LocalEulerAnglesHint: {x:
-8
, y: 0, z: 0}
--- !u!114 &3388061853811875004
MonoBehaviour:
m_ObjectHideFlags: 0
...
...
@@ -114586,7 +114586,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4226865422111836, guid: 864780f64143e044ba476358cde34b39, type: 3}
propertyPath: m_LocalPosition.y
value:
-0.41
value:
0.12
objectReference: {fileID: 0}
- target: {fileID: 4226865422111836, guid: 864780f64143e044ba476358cde34b39, type: 3}
propertyPath: m_LocalPosition.z
Storage/Assets/Res/Levels/Level3.prefab
View file @
5f1608c0
...
...
@@ -9875,13 +9875,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1388144024041319108}
m_LocalRotation: {x: -0
, y: -0, z: -0, w:
1}
m_LocalRotation: {x: -0
.06975647, y: 0, z: 0, w: 0.997564
1}
m_LocalPosition: {x: 0, y: 0.5094759, z: -0.1588525}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2380451859975094843}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x:
0
, y: 0, z: 0}
m_LocalEulerAnglesHint: {x:
-8
, y: 0, z: 0}
--- !u!114 &2144170710021341392
MonoBehaviour:
m_ObjectHideFlags: 0
...
...
@@ -30932,7 +30932,7 @@ MonoBehaviour:
cachedMesh: {fileID: 1044666760486720641, guid: 188a7f6966cec7d44b52b5c344f37345,
type: 3}
InvisibleUpdate: 0
readable:
1
readable:
0
--- !u!114 &6174908756435311075
MonoBehaviour:
m_ObjectHideFlags: 0
...
...
@@ -129495,7 +129495,7 @@ MonoBehaviour:
cachedMesh: {fileID: -7011429734207973542, guid: 188a7f6966cec7d44b52b5c344f37345,
type: 3}
InvisibleUpdate: 0
readable:
1
readable:
0
--- !u!114 &7076969204005980210
MonoBehaviour:
m_ObjectHideFlags: 0
...
...
@@ -131875,7 +131875,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6487835245184371423}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -0.
1
, z: 0}
m_LocalPosition: {x: 0, y: -0.
2
, z: 0}
m_LocalScale: {x: 100, y: 1, z: 100}
m_Children: []
m_Father: {fileID: 1969818788198913948}
Storage/Assets/Res/Levels/Level4.prefab
View file @
5f1608c0
...
...
@@ -62329,7 +62329,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3194231658186618696}
m_LocalRotation: {x: -0, y: -0.41915742, z: -0, w: 0.9079136}
m_LocalPosition: {x: 0.102, y: -0.
624
, z: -4.29}
m_LocalPosition: {x: 0.102, y: -0.
025
, z: -4.29}
m_LocalScale: {x: 8, y: 8, z: 8}
m_Children:
- {fileID: 3194231658186451818}
...
...
@@ -76278,7 +76278,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5028890651224010748}
m_LocalRotation: {x: -0.075730644, y: 0.98048186, z: -0.013972448, w: 0.18090075}
m_LocalPosition: {x: 1.2, y:
-0.13
, z: -3.3799996}
m_LocalPosition: {x: 1.2, y:
0.02
, z: -3.3799996}
m_LocalScale: {x: 8.5, y: 8.5, z: 8.5}
m_Children: []
m_Father: {fileID: 7917013256073000625}
Storage/Assets/Res/Levels/Level5.prefab
View file @
5f1608c0
...
...
@@ -119318,7 +119318,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 49bd86e2cfdb81d458813d8609a06235, type: 3}
propertyPath: m_LocalPosition.y
value:
-0.25
value:
0.226
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 49bd86e2cfdb81d458813d8609a06235, type: 3}
propertyPath: m_LocalPosition.z
...
...
@@ -119500,7 +119500,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 2d6d15b5004c7974f9d93c34e2469371, type: 3}
propertyPath: m_LocalPosition.y
value:
-0.57
value:
0.28
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 2d6d15b5004c7974f9d93c34e2469371, type: 3}
propertyPath: m_LocalPosition.z
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