Fixed infinite fall

This commit is contained in:
MartinRemi 2015-11-09 12:12:34 -05:00
parent 9b2cd431a5
commit 0b0c015eb0
6 changed files with 70 additions and 37 deletions

View File

@ -284,6 +284,47 @@ Prefab:
GameObject:
m_PrefabParentObject: {fileID: 101678, guid: b7819e17682d74b45a71d6831a413e0b, type: 2}
m_PrefabInternal: {fileID: 1024525637}
--- !u!1 &1302261674
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1302261676}
- 114: {fileID: 1302261675}
m_Layer: 0
m_Name: FallCheck
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1302261675
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1302261674}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c1e6722564abf8f4a9aacf7b96cedb6f, type: 3}
m_Name:
m_EditorClassIdentifier:
player: {fileID: 1189818989}
cam: {fileID: 1449410197}
--- !u!4 &1302261676
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1302261674}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
--- !u!1 &1449410197
GameObject:
m_ObjectHideFlags: 0

View File

@ -0,0 +1,15 @@
using UnityEngine;
using System.Collections;
public class FallCheck : MonoBehaviour {
public GameObject player;
public GameObject cam;
// Update is called once per frame
void FixedUpdate () {
if (player.transform.position.y < cam.transform.position.y - cam.transform.localScale.y)
player.transform.position = new Vector3(0, 0, 0);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c1e6722564abf8f4a9aacf7b96cedb6f
timeCreated: 1447087271
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -8,7 +8,6 @@ PlayerSettings:
defaultScreenOrientation: 4
targetDevice: 2
targetResolution: 0
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: Laboratoire_2_Equipe_2
@ -29,7 +28,6 @@ PlayerSettings:
androidShowActivityIndicatorOnLoading: -1
iosAppInBackgroundBehavior: 0
displayResolutionDialog: 1
iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1
allowedAutorotateToLandscapeRight: 1
@ -137,15 +135,6 @@ PlayerSettings:
iOSLaunchScreenFillPct: 100
iOSLaunchScreenSize: 100
iOSLaunchScreenCustomXibPath:
iOSLaunchScreeniPadType: 0
iOSLaunchScreeniPadImage: {fileID: 0}
iOSLaunchScreeniPadBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreeniPadFillPct: 100
iOSLaunchScreeniPadSize: 100
iOSLaunchScreeniPadCustomXibPath:
iOSDeviceRequirements: []
AndroidTargetDevice: 0
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
@ -235,8 +224,6 @@ PlayerSettings:
ps4SdkOverride:
ps4BGMPath:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
@ -254,13 +241,10 @@ PlayerSettings:
ps4pnGameCustomData: 1
playerPrefsSupport: 0
ps4ReprojectionSupport: 0
ps4UseAudio3dBackend: 0
ps4Audio3dVirtualSpeakerCount: 14
ps4attribUserManagement: 0
ps4attribMoveSupport: 0
ps4attrib3DSupport: 0
ps4attribShareSupport: 0
ps4IncludedModules: []
monoEnv:
psp2Splashimage: {fileID: 0}
psp2NPTrophyPackPath:

View File

@ -1,2 +1,2 @@
m_EditorVersion: 5.2.2f1
m_EditorVersion: 5.2.0f3
m_StandardAssetsVersion: 0

View File

@ -150,23 +150,4 @@ QualitySettings:
maximumLODLevel: 0
particleRaycastBudget: 4096
excludedTargetPlatforms: []
m_PerPlatformDefaultQuality:
Android: 2
BlackBerry: 2
GLES Emulation: 5
Nintendo 3DS: 5
PS3: 5
PS4: 5
PSM: 5
PSP2: 2
Samsung TV: 2
Standalone: 5
Tizen: 2
WP8: 5
Web: 5
WebGL: 3
Wii U: 5
Windows Store Apps: 5
XBOX360: 5
XboxOne: 5
iPhone: 2
m_PerPlatformDefaultQuality: {}