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
52eafd88
Commit
52eafd88
authored
Jan 26, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
铁球逻辑修改
parent
8a4f80ac
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
5895 additions
and
1114 deletions
+5895
-1114
.suo
SteelBall/.vs/SteelBall/v16/.suo
+0
-0
DemoChain.unity
SteelBall/Assets/0A1_Scenes/DemoChain.unity
+1320
-0
DemoChain.unity.meta
SteelBall/Assets/0A1_Scenes/DemoChain.unity.meta
+7
-0
SixLevelCollision.cs
.../Assets/0A2_Scripts/Battle/Collision/SixLevelCollision.cs
+2
-2
ChainHandle.cs
SteelBall/Assets/0A2_Scripts/Battle/View/ChainHandle.cs
+17
-13
Chain.meta
SteelBall/Assets/0A3_Prefabs/Chain.meta
+8
-0
SuoLian.fbx
SteelBall/Assets/0A3_Prefabs/Chain/SuoLian.fbx
+0
-0
SuoLian.fbx.meta
SteelBall/Assets/0A3_Prefabs/Chain/SuoLian.fbx.meta
+96
-0
CubeChild.prefab
SteelBall/Assets/0A3_Prefabs/CubeChild.prefab
+64
-64
Level06.prefab
SteelBall/Assets/Res/Prefabs/Levels/Level06.prefab
+4381
-1035
No files found.
SteelBall/.vs/SteelBall/v16/.suo
View file @
52eafd88
No preview for this file type
SteelBall/Assets/0A1_Scenes/DemoChain.unity
0 → 100644
View file @
52eafd88
This diff is collapsed.
Click to expand it.
SteelBall/Assets/0A1_Scenes/DemoChain.unity.meta
0 → 100644
View file @
52eafd88
fileFormatVersion: 2
guid: cf9256dcc0f94a048bdd3fdcfc65537c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
SteelBall/Assets/0A2_Scripts/Battle/Collision/SixLevelCollision.cs
View file @
52eafd88
...
...
@@ -33,9 +33,9 @@ public class SixLevelCollision : MonoBehaviour
//}
}
private
void
On
CollisionEnter
(
Collision
other
)
private
void
On
TriggerEnter
(
Collider
other
)
{
if
(
other
.
collider
.
gameObject
.
CompareTag
(
"Ball"
)
&&
m_bCollider
)
if
(
other
.
gameObject
.
CompareTag
(
"Ball"
)
&&
m_bCollider
)
{
m_bCollider
=
false
;
m_render
.
enabled
=
false
;
...
...
SteelBall/Assets/0A2_Scripts/Battle/View/ChainHandle.cs
View file @
52eafd88
...
...
@@ -6,7 +6,6 @@ using Obi;
public
class
ChainHandle
:
MonoBehaviour
{
public
ObiSolver
m_solver
;
public
Rigidbody
m_steelBallRigidBody
;
//铁球
public
Transform
SteelBallTrans
=>
m_steelBallRigidBody
.
transform
;
private
RectTransform
m_thumbRT
;
//摇杆
...
...
@@ -18,12 +17,14 @@ public class ChainHandle : MonoBehaviour
private
float
m_topColliderPosY
;
//Y位置
private
Vector3
m_maxHeightBallPos
=
new
Vector3
(
2.075f
,
3.0f
,
-
6.5f
);
//铁球最大高度
private
Transform
m_parentTrans
;
//父节点
private
HingeJoint
m_hingJoint
;
// Start is called before the first frame update
private
void
Awake
()
{
m_rigidBody
=
gameObject
.
GetComponent
<
Rigidbody
>();
m_topColliderPosY
=
transform
.
position
.
y
;
m_parentTrans
=
transform
.
parent
;
m_hingJoint
=
gameObject
.
GetComponent
<
HingeJoint
>();
//Lightmapping.giWorkflowMode = Lightmapping.GIWorkflowMode.Legacy;
}
private
void
OnCollisionEnter
(
Collision
other
)
...
...
@@ -207,28 +208,31 @@ public class ChainHandle : MonoBehaviour
{
if
(
hit
.
collider
.
gameObject
.
CompareTag
(
"Target"
))
{
//m_solver.simulateWhenInvisible = false;
//十字架位置
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
);
//设置铁球位置
m_steelBallRigidBody
.
isKinematic
=
true
;
m_steelBallRigidBody
.
transform
.
localPosition
=
m_maxHeightBallPos
;
m_steelBallRigidBody
.
transform
.
localRotation
=
Quaternion
.
identity
;
m_rigidBody
.
isKinematic
=
true
;
if
(
m_hingJoint
)
{
GameObject
.
Destroy
(
m_hingJoint
);
m_hingJoint
=
null
;
}
transform
.
localRotation
=
Quaternion
.
Euler
(
60
,
0
,
0
);
Vector3
varVec3
=
m_parentTrans
.
position
;
varVec3
.
x
=
hit
.
point
.
x
-
m_maxHeightBallPos
.
x
;
varVec3
.
y
=
hit
.
point
.
y
+
6.5
f
;
varVec3
.
y
=
hit
.
point
.
y
+
6.0
f
;
m_parentTrans
.
position
=
varVec3
;
GameServices
.
timerServices
.
Push
(
this
,
1
,
delegate
GameServices
.
timerServices
.
Push
(
this
,
0.1f
,
delegate
{
// if(m_solver
)
//
{
// m_solver.simulateWhenInvisible = true
;
//
}
if
(
m_steelBallR
igidBody
)
if
(!
m_hingJoint
)
{
m_hingJoint
=
gameObject
.
AddComponent
<
HingeJoint
>()
;
}
if
(
m_r
igidBody
)
{
m_
steelBallR
igidBody
.
isKinematic
=
false
;
m_
r
igidBody
.
isKinematic
=
false
;
}
});
}
...
...
SteelBall/Assets/0A3_Prefabs/Chain.meta
0 → 100644
View file @
52eafd88
fileFormatVersion: 2
guid: f164672bcb7897c4fa73b75c10ee6bf1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
SteelBall/Assets/0A3_Prefabs/Chain/SuoLian.fbx
0 → 100644
View file @
52eafd88
File added
SteelBall/Assets/0A3_Prefabs/Chain/SuoLian.fbx.meta
0 → 100644
View file @
52eafd88
fileFormatVersion: 2
guid: 76266eba564a24c4daca02f397c20384
ModelImporter:
serializedVersion: 19300
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
SteelBall/Assets/0A3_Prefabs/CubeChild.prefab
View file @
52eafd88
This diff is collapsed.
Click to expand it.
SteelBall/Assets/Res/Prefabs/Levels/Level06.prefab
View file @
52eafd88
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