zoom zoom

This commit is contained in:
ntr committed 2023-06-26 23:45:55 +10:00
1 parent 8fd4fb9fd6
commit 384ed9870d
12 files changed
+1049 -195

No files matched your search

+3 -3
View File
@@ -2,13 +2,13 @@ using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour {
public float speedH = 2.0f;
public float speedV = 2.0f;
public float speedH = 0.5f;
public float speedV = 0.5f;
private float yaw = 0.0f;
private float pitch = 0.0f;
void Update () {
void Update() {
yaw += speedH * Input.GetAxis("Mouse X");
pitch -= speedV * Input.GetAxis("Mouse Y");
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 437f35772a140f8409c05a42e52dbf88
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
BIN
View File
Binary file not shown.
+105
View File
@@ -0,0 +1,105 @@
fileFormatVersion: 2
guid: 0adb34544db309646878f9cfa9ee1c2d
ModelImporter:
serializedVersion: 21202
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 1
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
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
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
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
BIN
View File
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2295761299d80ba458830a6f7aba48ec
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
BIN
View File
Binary file not shown.
+105
View File
@@ -0,0 +1,105 @@
fileFormatVersion: 2
guid: 7140281db71bac44f958af6e8c7f48b3
ModelImporter:
serializedVersion: 21202
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 1
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
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
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
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
BIN
View File
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2827901ce32b1c94bbcb5b1c9979158c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+685 -93
View File
@@ -123,90 +123,210 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &613649982
--- !u!1001 &82892902
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.z
value: 20
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.w
value: 0.50008726
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.x
value: -0.49991274
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.y
value: 0.50008726
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.z
value: 0.49991274
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -89.98
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_Name
value: tunnel (1)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
--- !u!1 &184499453 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
m_PrefabInstance: {fileID: 1834942344}
m_PrefabAsset: {fileID: 0}
--- !u!65 &184499457
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 613649985}
- component: {fileID: 613649984}
- component: {fileID: 613649983}
m_Layer: 0
m_Name: Camera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!81 &613649983
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 613649982}
m_Enabled: 1
--- !u!20 &613649984
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 613649982}
m_GameObject: {fileID: 184499453}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &613649985
Transform:
m_Size: {x: 2.0000033, y: 21.000006, z: 10.000006}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &247855686 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
m_PrefabInstance: {fileID: 1382192981}
m_PrefabAsset: {fileID: 0}
--- !u!65 &247855690
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 613649982}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 4.75, y: 7.16, z: -51.1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_GameObject: {fileID: 247855686}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 2.0000033, y: 21.000006, z: 10.000006}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &508085912
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.z
value: 40
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.w
value: 0.50008726
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.x
value: -0.49991274
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.y
value: 0.50008726
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.z
value: 0.49991274
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -89.98
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_Name
value: tunnel (2)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
--- !u!1 &525291802 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
m_PrefabInstance: {fileID: 1916114013}
m_PrefabAsset: {fileID: 0}
--- !u!65 &525291806
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 525291802}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 2.0000024, y: 21.00001, z: 10.000007}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &552601396 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
m_PrefabInstance: {fileID: 1170480721}
m_PrefabAsset: {fileID: 0}
--- !u!65 &552601400
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 552601396}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 2, y: 21.000002, z: 10.000001}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &619721776 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
m_PrefabInstance: {fileID: 82892902}
m_PrefabAsset: {fileID: 0}
--- !u!65 &619721780
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 619721776}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 2, y: 21.000002, z: 10.000001}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &705507993
GameObject:
m_ObjectHideFlags: 0
@@ -217,6 +337,7 @@ GameObject:
m_Component:
- component: {fileID: 705507995}
- component: {fileID: 705507994}
- component: {fileID: 705507996}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
@@ -301,6 +422,76 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!65 &705507996
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &865536258
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.x
value: 7.3
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.z
value: 81.1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.w
value: 0.38571903
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.x
value: -0.38571903
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.y
value: 0.59263885
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.z
value: 0.59263885
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -66.116
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_Name
value: tunnel (4)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
--- !u!1 &1048473337
GameObject:
m_ObjectHideFlags: 0
@@ -313,7 +504,6 @@ GameObject:
- component: {fileID: 1048473341}
- component: {fileID: 1048473340}
- component: {fileID: 1048473339}
- component: {fileID: 1048473342}
m_Layer: 0
m_Name: Camera
m_TagString: Untagged
@@ -401,18 +591,345 @@ Camera:
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!114 &1048473342
MonoBehaviour:
--- !u!1001 &1170480721
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.w
value: 0.50008726
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.x
value: -0.49991274
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.y
value: 0.50008726
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.z
value: 0.49991274
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -89.98
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_Name
value: tunnel
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
--- !u!1001 &1382192981
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_RootOrder
value: 8
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.x
value: 27
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.z
value: 111.8
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.w
value: 0.34988642
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.x
value: -0.34988642
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.y
value: 0.614475
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.z
value: 0.614475
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -59.315002
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_Name
value: tunnel (6)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
--- !u!1 &1469833962 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
m_PrefabInstance: {fileID: 508085912}
m_PrefabAsset: {fileID: 0}
--- !u!65 &1469833966
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1048473337}
m_GameObject: {fileID: 1469833962}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4c4a5cda8d92fba4aba88e044f32385e, type: 3}
m_Name:
m_EditorClassIdentifier:
serializedVersion: 2
m_Size: {x: 2, y: 21.000002, z: 10.000001}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &1482046200
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.z
value: 60
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.w
value: 0.4304593
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.x
value: -0.4304593
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.y
value: 0.56098557
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.z
value: 0.56098557
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -75
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_Name
value: tunnel (3)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
--- !u!1 &1667192543 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
m_PrefabInstance: {fileID: 2115155719}
m_PrefabAsset: {fileID: 0}
--- !u!65 &1667192547
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1667192543}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 2.0000002, y: 21.000004, z: 10}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &1834942344
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.x
value: 17.3
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.z
value: 95.9
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.w
value: 0.34988642
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.x
value: -0.34988642
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.y
value: 0.614475
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.z
value: 0.614475
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -59.315002
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_Name
value: tunnel (5)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
--- !u!1 &1876781881 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
m_PrefabInstance: {fileID: 865536258}
m_PrefabAsset: {fileID: 0}
--- !u!65 &1876781885
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1876781881}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 2.0000005, y: 21, z: 10}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &1916114013
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_RootOrder
value: 10
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.x
value: 67.4
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.z
value: 139.9
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.w
value: 0.17547078
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.x
value: -0.17547078
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.y
value: 0.6849891
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.z
value: 0.6849891
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -28.737
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_Name
value: tunnel (8)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
--- !u!1 &1972710416
GameObject:
m_ObjectHideFlags: 0
@@ -427,7 +944,7 @@ GameObject:
- component: {fileID: 1972710417}
- component: {fileID: 1972710422}
- component: {fileID: 1972710421}
- component: {fileID: 1972710423}
- component: {fileID: 1972710424}
m_Layer: 0
m_Name: Ship
m_TagString: Untagged
@@ -506,13 +1023,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1972710416}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3.43, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 2, z: 5}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1048473338}
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1972710421
MonoBehaviour:
@@ -526,8 +1043,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 40716ff800be8d74ead775a18a496d89, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ForceAmp: 2
thrustMag: 10
ship: {fileID: 1972710416}
camera: {fileID: 1048473341}
--- !u!54 &1972710422
Rigidbody:
m_ObjectHideFlags: 0
@@ -544,17 +1062,91 @@ Rigidbody:
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &1972710423
MonoBehaviour:
--- !u!65 &1972710424
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1972710416}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fb2c71947a1f324288916d506ccb34d, type: 3}
m_Name:
m_EditorClassIdentifier:
speedH: 2
speedV: 2
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &1991057843 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
m_PrefabInstance: {fileID: 1482046200}
m_PrefabAsset: {fileID: 0}
--- !u!65 &1991057847
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1991057843}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 2, y: 21.000002, z: 10}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &2115155719
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_RootOrder
value: 9
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.x
value: 41.4
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalPosition.z
value: 128.8
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.w
value: 0.27220982
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.x
value: -0.27220982
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.y
value: 0.65261155
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalRotation.z
value: 0.65261155
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -45.28302
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
propertyPath: m_Name
value: tunnel (7)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7140281db71bac44f958af6e8c7f48b3, type: 3}
+129 -99
View File
@@ -1,120 +1,150 @@
using UnityEngine;
public class ShipControls : MonoBehaviour
{
//Use to switch between Force Modes
public class ShipControls : MonoBehaviour {
enum ModeSwitching { Start, Impulse, Acceleration, Force, VelocityChange };
ModeSwitching m_ModeSwitching;
Vector3 m_StartPos, m_StartForce;
Vector3 m_NewForce;
Vector3 m_StartPos;
Vector3 m_StartForce;
Vector3 m_Thrust;
float m_thrustBase;
float m_stabliseMag;
Rigidbody m_Rigidbody;
public float m_ForceAmp;
public GameObject ship;
public Camera camera;
void Start()
{
//You get the Rigidbody component you attach to the GameObject
void Start() {
m_Rigidbody = GetComponent<Rigidbody>();
//This starts at first mode (nothing happening yet)
m_ModeSwitching = ModeSwitching.Start;
//Initialising the force which is used on GameObject in various ways
m_NewForce = new Vector3(-5.0f, 1.0f, 0.0f);
//The GameObject's starting position and Rigidbody position
m_StartPos = transform.position;
m_StartForce = m_Rigidbody.transform.position;
m_Thrust = new Vector3(0.0f, 0.0f, 0.0f);
m_StartPos = camera.transform.position;
m_StartForce = m_Rigidbody.transform.forward;
m_thrustBase = 10.0f;
m_stabliseMag = 75.0f;
Cursor.lockState = CursorLockMode.Locked;
}
void FixedUpdate()
{
//If the current mode is not the starting mode (or the GameObject is not reset), the force can change
if (m_ModeSwitching != ModeSwitching.Start)
{
//The force changes depending what you input into the text fields
m_NewForce = ship.transform.forward * m_ForceAmp;
}
void Update() {
// update the thrust vector every frame
m_Thrust = camera.transform.forward;
//Here, switching modes depend on button presses in the Game mode
switch (m_ModeSwitching)
{
//This is the starting mode which resets the GameObject
case ModeSwitching.Start:
//This resets the GameObject and Rigidbody to their starting positions
transform.position = m_StartPos;
m_Rigidbody.transform.position = m_StartForce;
//This resets the velocity of the Rigidbody
m_Rigidbody.velocity = new Vector3(0f, 0f, 0f);
break;
//These are the modes ForceMode can force on a Rigidbody
//This is Acceleration mode
case ModeSwitching.Acceleration:
//Use Acceleration as the force on the Rigidbody
m_Rigidbody.AddForce(m_NewForce, ForceMode.Acceleration);
break;
//This is Force Mode, using a continuous force on the Rigidbody considering its mass
case ModeSwitching.Force:
//Use Force as the force on GameObject’s Rigidbody
m_Rigidbody.AddForce(m_NewForce, ForceMode.Force);
break;
//This is Impulse Mode, which involves using the Rigidbody’s mass to apply an instant impulse force.
case ModeSwitching.Impulse:
//Use Impulse as the force on GameObject
m_Rigidbody.AddForce(m_NewForce, ForceMode.Impulse);
break;
//This is VelocityChange which involves ignoring the mass of the GameObject and impacting it with a sudden speed change in a direction
case ModeSwitching.VelocityChange:
//Make a Velocity change on the Rigidbody
m_Rigidbody.AddForce(m_NewForce, ForceMode.VelocityChange);
break;
}
// do everything else input related on every frame too
processInput();
}
void FixedUpdate() {
float thrustMag = getThrustMagnitude();
m_Rigidbody.AddForce(m_Thrust * thrustMag, ForceMode.Acceleration);
// stablise ship towards camera position
float step = m_stabliseMag * Time.fixedDeltaTime;
m_Rigidbody.rotation = Quaternion.RotateTowards(transform.rotation, camera.transform.rotation, step);
}
float getThrustMagnitude() {
if (Input.GetMouseButton(0))
return 1.0f * m_thrustBase;
if (Input.GetMouseButton(1))
return -1.0f * m_thrustBase;
return 0.0f;
}
void processInput() {
if (Input.GetKey(KeyCode.Space))
Respawn();
}
void Respawn() {
m_Thrust = new Vector3(0.0f, 0.0f, 0.0f);
transform.position = m_StartPos;
m_Rigidbody.transform.forward = m_StartForce;
}
// {
// //If the current mode is not the starting mode (or the GameObject is not reset), the force can change
// if (m_ModeSwitching != ModeSwitching.Start)
// {
// //The force changes depending what you input into the text fields
// m_NewForce = camera.transform.position;
// }
// //Here, switching modes depend on button presses in the Game mode
// switch (m_ModeSwitching)
// {
// //This is the starting mode which resets the GameObject
// case ModeSwitching.Startt
// //This resets the GameObject and Rigidbody to their starting positions
// transform.position = m_StartPos;
// m_Rigidbody.transform.forward = m_StartForce;
// //This resets the velocity of the Rigidbody
// m_Rigidbody.velocity = new Vector3(0f, 0f, 0f);
// break;
// //These are the modes ForceMode can force on a Rigidbody
// //This is Acceleration mode
// case ModeSwitching.Acceleration:
// //Use Acceleration as the force on the Rigidbody
// break;
// //This is Force Mode, using a continuous force on the Rigidbody considering its mass
// case ModeSwitching.Force:
// //Use Force as the force on GameObject’s Rigidbody
// break;
// //This is Impulse Mode, which involves using the Rigidbody’s mass to apply an instant impulse force.
// case ModeSwitching.Impulse:
// //Use Impulse as the force on GameObject
// break;
// //This is VelocityChange which involves ignoring the mass of the GameObject and impacting it with a sudden speed change in a direction
// case ModeSwitching.VelocityChange:
// //Make a Velocity change on the Rigidbody
// break;
// }
// }
//The function outputs buttons, text fields, and other interactable UI elements to the Scene in Game view
void OnGUI()
{
//Press the button to reset the GameObject and Rigidbody
if (GUI.Button(new Rect(100, 0, 150, 30), "Reset"))
{
//This switches to the start/reset case
m_ModeSwitching = ModeSwitching.Start;
}
// void OnGUI()
// {
// //Press the button to reset the GameObject and Rigidbody
// if (GUI.Button(new Rect(100, 0, 150, 30), "Reset"))
// {
// //This switches to the start/reset case
// m_ModeSwitching = ModeSwitching.Start;
// }
//When you press the Acceleration button, switch to Acceleration mode
if (GUI.Button(new Rect(100, 30, 150, 30), "Apply Acceleration"))
{
//Switch to Acceleration (apply acceleration force to GameObject)
m_ModeSwitching = ModeSwitching.Acceleration;
}
// //When you press the Acceleration button, switch to Acceleration mode
// if (GUI.Button(new Rect(100, 30, 150, 30), "Apply Acceleration"))
// {
// //Switch to Acceleration (apply acceleration force to GameObject)
// m_ModeSwitching = ModeSwitching.Acceleration;
// }
//If you press the Impulse button
if (GUI.Button(new Rect(100, 60, 150, 30), "Apply Impulse"))
{
//Switch to impulse (apply impulse forces to GameObject)
m_ModeSwitching = ModeSwitching.Impulse;
}
// //If you press the Impulse button
// if (GUI.Button(new Rect(100, 60, 150, 30), "Apply Impulse"))
// {
// //Switch to impulse (apply impulse forces to GameObject)
// m_ModeSwitching = ModeSwitching.Impulse;
// }
//If you press the Force Button, switch to Force state
if (GUI.Button(new Rect(100, 90, 150, 30), "Apply Force"))
{
//Switch to Force (apply force to GameObject)
m_ModeSwitching = ModeSwitching.Force;
}
// //If you press the Force Button, switch to Force state
// if (GUI.Button(new Rect(100, 90, 150, 30), "Apply Force"))
// {
// //Switch to Force (apply force to GameObject)
// m_ModeSwitching = ModeSwitching.Force;
// }
//Press the button to switch to VelocityChange state
if (GUI.Button(new Rect(100, 120, 150, 30), "Apply Velocity Change"))
{
//Switch to velocity changing
m_ModeSwitching = ModeSwitching.VelocityChange;
}
}
// //Press the button to switch to VelocityChange state
// if (GUI.Button(new Rect(100, 120, 150, 30), "Apply Velocity Change"))
// {
// //Switch to velocity changing
// m_ModeSwitching = ModeSwitching.VelocityChange;
// }
// }
}