8 Commits

Author SHA1 Message Date
Jan Groß
9da1f82f20 LightLurch ability
Makes the lurch glow.
Can increase and decrease light as well as emission if the special "LightUp" ability is used.
2018-09-01 17:30:37 +02:00
Jan Groß
b6ea22e42b Merge pull request #2 from JanGross/respawn
Merge Respawn to Master
2018-09-01 12:49:56 +02:00
Jan Groß
f49fdce1be Merge branch 'master' into respawn 2018-09-01 12:49:46 +02:00
Jan Groß
e135fd5d19 LFS Commit for Gizmos 2018-09-01 12:42:46 +02:00
Jan Groß
5692f45d51 Merge pull request #1 from JanGross/player_movement
Merge Player movement
2018-09-01 12:30:58 +02:00
Jan Groß
9e97662891 Spawnpoint and respawn stuff
New LurchRespawn component holds respawn points and checks for level bounds as well as fall distance.
The closest respawn point will be selected, all previous respawn points will be marked invalid (no longer available).
2018-09-01 12:15:39 +02:00
Richard Ott
d31fb78dea Basic Test level and lurch movement 2018-09-01 12:15:38 +02:00
Jan Groß
e21dec9211 Add .gitattributes 2018-09-01 00:52:24 +02:00
22 changed files with 2740 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 681795e0efcef2f49b1daca1f3fa92ab guid: 81668775f3ab28c46b8b7219ff7f9ea8
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

BIN
Assets/Gizmos/Respawn.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,88 @@
fileFormatVersion: 2
guid: ff13115e32bcba84594160355f08dce4
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 7
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Gizmos/RespawnActive.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,88 @@
fileFormatVersion: 2
guid: 6594b6c361557e246bd4394d0e4d4dbf
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 7
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Gizmos/RespawnInactive.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,88 @@
fileFormatVersion: 2
guid: 855b14cce594986429de77ecb342d023
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 7
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -9,7 +9,7 @@ Material:
m_Name: Lurch m_Name: Lurch
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: m_ShaderKeywords:
m_LightmapFlags: 4 m_LightmapFlags: 6
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0 m_DoubleSidedGI: 0
m_CustomRenderQueue: -1 m_CustomRenderQueue: -1

View File

@@ -21,7 +21,7 @@ GameObject:
- component: {fileID: 4211561106277860} - component: {fileID: 4211561106277860}
m_Layer: 0 m_Layer: 0
m_Name: Lurch m_Name: Lurch
m_TagString: Untagged m_TagString: Player
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
@@ -35,6 +35,9 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 4349673492578080} - component: {fileID: 4349673492578080}
- component: {fileID: 114123996009525022} - component: {fileID: 114123996009525022}
- component: {fileID: 114729016115082176}
- component: {fileID: 114557432824313468}
- component: {fileID: 114003328164428386}
m_Layer: 0 m_Layer: 0
m_Name: CameraHolder m_Name: CameraHolder
m_TagString: Untagged m_TagString: Untagged
@@ -71,6 +74,7 @@ GameObject:
- component: {fileID: 23689017160285550} - component: {fileID: 23689017160285550}
- component: {fileID: 65346116814365424} - component: {fileID: 65346116814365424}
- component: {fileID: 54155385480013682} - component: {fileID: 54155385480013682}
- component: {fileID: 108062020484346290}
m_Layer: 0 m_Layer: 0
m_Name: LurchTest m_Name: LurchTest
m_TagString: Untagged m_TagString: Untagged
@@ -249,6 +253,63 @@ AudioListener:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1444907702125456} m_GameObject: {fileID: 1444907702125456}
m_Enabled: 1 m_Enabled: 1
--- !u!108 &108062020484346290
Light:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1462012476334488}
m_Enabled: 1
serializedVersion: 8
m_Type: 2
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 5
m_Range: 20
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!114 &114003328164428386
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1444832767951054}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 167337a6a977deb408440dbf31acb6c9, type: 3}
m_Name:
m_EditorClassIdentifier:
respawnPoints:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
lowerBounds: {fileID: 0}
lurch: {fileID: 1462012476334488}
UpdateFrequenzy: 15
maxFallDist: 25
respawnKey: 114
--- !u!114 &114123996009525022 --- !u!114 &114123996009525022
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@@ -275,3 +336,51 @@ MonoBehaviour:
cooldown: 0 cooldown: 0
canGlide: 1 canGlide: 1
glideForce: 3 glideForce: 3
--- !u!114 &114557432824313468
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1444832767951054}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b614d5a678d653549b924deec5548458, type: 3}
m_Name:
m_EditorClassIdentifier:
standardRadius: 20
standardIntensity: 5
tinyRadius: 7
tinyIntensity: 4
maxRadius: 150
maxIntensity: 6
emissionMultiplier: 1
maxEmission: 1.5
minEmission: 0.25
baseEmission: 0.5
triggerButton: 102
litDuration: 4
unLitDuration: 3
animationSpeed: 1
state: 0
t: 0
ldCounter: 0
--- !u!114 &114729016115082176
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1444832767951054}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 167337a6a977deb408440dbf31acb6c9, type: 3}
m_Name:
m_EditorClassIdentifier:
respawnPoints:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
lowerBounds: {fileID: 0}
lurch: {fileID: 1462012476334488}
UpdateFrequenzy: 15
maxFallDist: 25
respawnKey: 114

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b5f8c6ef1eb4bb846a5380eaf975ffa7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,766 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 10
m_AtlasSize: 512
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 256
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &170076733
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 170076735}
- component: {fileID: 170076734}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &170076734
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 170076733}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 1
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &170076735
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 170076733}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &245146341
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 245146345}
- component: {fileID: 245146344}
- component: {fileID: 245146343}
- component: {fileID: 245146342}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &245146342
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 245146341}
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!23 &245146343
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 245146341}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 7884fe424030fd34c89ef6ec8c0f7a0c, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &245146344
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 245146341}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &245146345
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 245146341}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 10.01, y: 2.9999652, z: 12.92}
m_LocalScale: {x: 12.046, y: 12.629, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &338689725
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 338689729}
- component: {fileID: 338689728}
- component: {fileID: 338689727}
- component: {fileID: 338689726}
m_Layer: 0
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &338689726
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 338689725}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &338689727
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 338689725}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 1c01f194ec49d1c40a582ad83ee7ff1e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &338689728
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 338689725}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &338689729
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 338689725}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.8593802, y: 0.17568, z: -4.5059457}
m_LocalScale: {x: 3.524, y: 0.6428481, z: 3.524}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &459116366
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 459116367}
m_Layer: 0
m_Name: RespawnPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &459116367
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 459116366}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.89, y: 1.86, z: -4.53}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &489137739
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 489137740}
m_Layer: 0
m_Name: RespawnPoint (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &489137740
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 489137739}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 8.83, y: 10.55, z: 12.97}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &793616625
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 793616629}
- component: {fileID: 793616628}
- component: {fileID: 793616627}
- component: {fileID: 793616626}
m_Layer: 0
m_Name: Quad
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &793616626
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 793616625}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &793616627
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 793616625}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &793616628
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 793616625}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &793616629
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 793616625}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0.16311312, y: -0.026867867, z: -0.140594}
m_LocalScale: {x: 30, y: 30, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1086203634 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1462012476334488, guid: 8bcf2afca6664234f83b5ee8381b1975,
type: 2}
m_PrefabInternal: {fileID: 1187842046}
--- !u!1001 &1187842046
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4211561106277860, guid: 8bcf2afca6664234f83b5ee8381b1975, type: 2}
propertyPath: m_LocalPosition.x
value: -0.23070383
objectReference: {fileID: 0}
- target: {fileID: 4211561106277860, guid: 8bcf2afca6664234f83b5ee8381b1975, type: 2}
propertyPath: m_LocalPosition.y
value: 3.253488
objectReference: {fileID: 0}
- target: {fileID: 4211561106277860, guid: 8bcf2afca6664234f83b5ee8381b1975, type: 2}
propertyPath: m_LocalPosition.z
value: -7.428097
objectReference: {fileID: 0}
- target: {fileID: 4211561106277860, guid: 8bcf2afca6664234f83b5ee8381b1975, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4211561106277860, guid: 8bcf2afca6664234f83b5ee8381b1975, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4211561106277860, guid: 8bcf2afca6664234f83b5ee8381b1975, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4211561106277860, guid: 8bcf2afca6664234f83b5ee8381b1975, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4211561106277860, guid: 8bcf2afca6664234f83b5ee8381b1975, type: 2}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8bcf2afca6664234f83b5ee8381b1975, type: 2}
m_IsPrefabAsset: 0
--- !u!1 &1187842047 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1444832767951054, guid: 8bcf2afca6664234f83b5ee8381b1975,
type: 2}
m_PrefabInternal: {fileID: 1187842046}
--- !u!114 &1187842048
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1187842047}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 167337a6a977deb408440dbf31acb6c9, type: 3}
m_Name:
m_EditorClassIdentifier:
respawnPoints:
- {fileID: 459116366}
- {fileID: 1787826825}
- {fileID: 489137739}
lowerBounds: {fileID: 1287344752}
lurch: {fileID: 1086203634}
UpdateFrequenzy: 15
maxFallDist: 25
respawnKey: 114
--- !u!114 &1187842051
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1187842047}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1506266c448cec14fada221ffd4aced2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1287344748
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1287344752}
- component: {fileID: 1287344751}
- component: {fileID: 1287344750}
m_Layer: 0
m_Name: LowerBounds
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &1287344750
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1287344748}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1287344751
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1287344748}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1287344752
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1287344748}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0.9, y: -35.4, z: -3.9}
m_LocalScale: {x: 100, y: 100, z: 100}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1787826825
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1787826826}
m_Layer: 0
m_Name: RespawnPoint (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1787826826
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1787826825}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.7, y: 4.27, z: 2.42}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2030340302
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2030340306}
- component: {fileID: 2030340305}
- component: {fileID: 2030340304}
- component: {fileID: 2030340303}
m_Layer: 0
m_Name: Cylinder (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &2030340303
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2030340302}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2030340304
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2030340302}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 1c01f194ec49d1c40a582ad83ee7ff1e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &2030340305
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2030340302}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &2030340306
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2030340302}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.63, y: 1.54, z: 2.53}
m_LocalScale: {x: 3.524, y: 1.8712665, z: 3.524}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c3c3ced8973606c4cae05a615f0b0097
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -114,7 +114,6 @@ public class LurchMovement : MonoBehaviour {
if (Input.GetButton("Fire1") && currentJumpForce < maxJumpForce) if (Input.GetButton("Fire1") && currentJumpForce < maxJumpForce)
{ {
currentJumpForce += forceIncreaseSpeed; currentJumpForce += forceIncreaseSpeed;
lerpedColor = Color.Lerp(normalColor, fullyChargedColor, t); lerpedColor = Color.Lerp(normalColor, fullyChargedColor, t);
if (t < 1.0f) if (t < 1.0f)
{ {
@@ -175,7 +174,7 @@ public class LurchMovement : MonoBehaviour {
} }
bool LurchOnGround() public bool LurchOnGround()
{ {
RaycastHit hit; RaycastHit hit;
if (Physics.Raycast(theLurch.position, Vector3.down, out hit, 0.36f) && cooldown <= 0.0f) if (Physics.Raycast(theLurch.position, Vector3.down, out hit, 0.36f) && cooldown <= 0.0f)

View File

@@ -0,0 +1,133 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LurchRespawn : MonoBehaviour {
//Spawnpoints
[SerializeField]
private List<GameObject> respawnPoints = new List<GameObject>();
private GameObject lastRespawnPoint;
private int lastRespawnPointIndex;
//Refs
[SerializeField]
private Transform lowerBounds;
//ExtRefs
[SerializeField]
private GameObject lurch;
private LurchMovement compLurchMovement;
//States
private bool offGround = false;
private Vector3 lastGroundPos;
//Settings
[Header("Settings")]
[SerializeField]
[Tooltip("Update the spawnpoint every n frames")]
private int UpdateFrequenzy = 15;
[SerializeField]
private float maxFallDist = 100;
[SerializeField]
private KeyCode respawnKey = KeyCode.R;
void Start () {
if (respawnPoints.Count == 0)
{
this.enabled = false;
throw new System.Exception("No respawn points assigned");
}
compLurchMovement = gameObject.GetComponent<LurchMovement>();
lastGroundPos = lurch.transform.position;
lastRespawnPoint = respawnPoints[0];
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown(respawnKey))
{
RespawnLurch("Player respawned");
}
if(!offGround)
{
if(!compLurchMovement.LurchOnGround())
{
offGround = true;
lastGroundPos = lurch.transform.position;
}
} else
{
if (compLurchMovement.LurchOnGround())
{
offGround = false;
float fallDist = Vector3.Distance(lurch.transform.position, lastGroundPos);
if (fallDist > maxFallDist)
{
//We fell too far
RespawnLurch("Lurch fell too far");
}
lastGroundPos = lurch.transform.position;
}
}
if(Time.frameCount % UpdateFrequenzy == 0)
{
UpdateRespawnPoint();
}
if (Time.frameCount % UpdateFrequenzy * 2 == 0)
{
CheckBounds();
}
}
private void CheckBounds()
{
if(transform.position.y < lowerBounds.position.y)
{
RespawnLurch("Lurch went out of bounds");
}
}
private void UpdateRespawnPoint()
{
float nextPointDist;
float lastPointDist = Vector3.Distance(transform.position, lastRespawnPoint.transform.position);
for (int i = lastRespawnPointIndex; i < respawnPoints.Count; i++)
{
nextPointDist = Vector3.Distance(transform.position, respawnPoints[i].transform.position);
if (nextPointDist < lastPointDist)
{
lastRespawnPoint = respawnPoints[i];
lastRespawnPointIndex = i;
}
}
}
public void RespawnLurch(string message = "Lurch respawned")
{
Debug.LogWarning("Lurch respawned: " + message);
lurch.transform.position = lastRespawnPoint.transform.position;
}
private void OnDrawGizmos()
{
for(int i = 0; i < respawnPoints.Count; i++)
{
if(respawnPoints[i] == lastRespawnPoint)
{
Gizmos.DrawIcon(respawnPoints[i].transform.position, "RespawnActive.png");
} else if (i < lastRespawnPointIndex)
{
Gizmos.DrawIcon(respawnPoints[i].transform.position, "RespawnInactive.png");
} else
Gizmos.DrawIcon(respawnPoints[i].transform.position, "Respawn.png");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 167337a6a977deb408440dbf31acb6c9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,131 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LightLurch : MonoBehaviour {
private enum states { standard, lit, unlit }
[Header("Distances")]
[SerializeField]
private float standardRadius, standardIntensity;
[SerializeField]
private float tinyRadius, tinyIntensity;
[SerializeField]
private float maxRadius, maxIntensity;
[Header("Emission")]
[SerializeField]
private float emissionMultiplier = 1;
private float emissionValue;
[SerializeField]
private float maxEmission, minEmission, baseEmission = 1;
private float intensitySnapshot;
private Light lightSource;
private Renderer lurchRenderer;
[SerializeField]
private KeyCode triggerButton;
[SerializeField]
private float litDuration;
[SerializeField]
private float unLitDuration;
[SerializeField]
private float animationSpeed;
[Header("Debug")]
[SerializeField]
private states state;
[SerializeField]
private float t = 0;
[SerializeField]
private float ldCounter;
private float llCounter;
// Use this for initialization
void Start () {
state = states.standard;
GameObject lurch = GetComponent<LurchMovement>().theLurch.gameObject;
lightSource = lurch.GetComponent<Light>();
lurchRenderer = lurch.GetComponent<Renderer>();
lightSource.color = lurchRenderer.material.GetColor("_Color");
intensitySnapshot = lightSource.intensity;
lurchRenderer.material.SetColor("_EmissionColor", lightSource.color * (emissionMultiplier * emissionValue));
emissionValue = baseEmission;
lurchRenderer.material.EnableKeyword("_EMISSION");
}
// Update is called once per frame
void Update () {
t += Time.deltaTime * animationSpeed;
lurchRenderer.material.SetColor("_EmissionColor", lightSource.color * (emissionMultiplier * emissionValue));
switch (state)
{
case states.standard:
StandardGlow();
break;
case states.lit:
LightUp();
break;
case states.unlit:
GlowLow();
break;
}
if (Input.GetKeyDown(triggerButton) && state == states.standard)
{
t = 0;
ldCounter = litDuration;
llCounter = animationSpeed;
state = states.lit;
}
}
private void StandardGlow()
{
lightSource.intensity = Mathf.Lerp(tinyIntensity, standardIntensity, t);
lightSource.range = Mathf.Lerp(tinyRadius, standardRadius, t);
emissionValue = Mathf.Lerp(minEmission, baseEmission, t);
}
private void LightUp()
{
lightSource.intensity = Mathf.Lerp(standardIntensity, maxIntensity, t);
lightSource.range = Mathf.Lerp(standardRadius, maxRadius, t);
emissionValue = Mathf.Lerp(baseEmission, maxEmission, t);
if (ldCounter <= 0)
{
t = 0;
state = states.unlit;
ldCounter = unLitDuration;
llCounter = animationSpeed;
return;
}
ldCounter -= Time.deltaTime;
}
private void GlowLow()
{
lightSource.intensity = Mathf.Lerp(maxIntensity, tinyIntensity, t);
lightSource.range = Mathf.Lerp(maxRadius, tinyRadius, t);
emissionValue = Mathf.Lerp(maxEmission, minEmission, t);
if (llCounter <= 0)
{
if (ldCounter <= 0)
{
t = 0;
state = states.standard;
llCounter = animationSpeed;
return;
}
ldCounter -= Time.deltaTime;
}
llCounter -= Time.deltaTime;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b614d5a678d653549b924deec5548458
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b8b7c82b907af1c45a4d5abd120ab492
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,63 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DarkAmbience : MonoBehaviour {
private float defaultEnvLightingIntensity, defaultEnfReflectionIntensity;
[SerializeField]
private float targetEnvLightingIntensity, targetEnfReflectionIntensity;
[SerializeField]
private float lerpSpeed;
[SerializeField]
private bool isDark = false;
private float t = 0;
// Use this for initialization
void Start () {
defaultEnvLightingIntensity = RenderSettings.ambientIntensity;
defaultEnfReflectionIntensity = RenderSettings.reflectionIntensity;
}
public void SwitchDarkness(bool dark)
{
isDark = dark;
t = 0;
}
private void OnValidate()
{
t = 0;
}
private void OnTriggerEnter(Collider other)
{
if(other.transform.root.tag == "Player")
{
SwitchDarkness(true);
}
}
private void OnTriggerExit(Collider other)
{
if (other.transform.root.tag == "Player")
{
SwitchDarkness(false);
}
}
// Update is called once per frame
void Update () {
if(isDark)
{
RenderSettings.ambientIntensity = Mathf.Lerp(defaultEnvLightingIntensity, targetEnvLightingIntensity, t);
RenderSettings.reflectionIntensity = Mathf.Lerp(defaultEnfReflectionIntensity, targetEnfReflectionIntensity, t);
}
else
{
RenderSettings.ambientIntensity = Mathf.Lerp(targetEnvLightingIntensity, defaultEnvLightingIntensity, t);
RenderSettings.reflectionIntensity = Mathf.Lerp(targetEnfReflectionIntensity, defaultEnfReflectionIntensity , t);
}
t += Time.deltaTime * lerpSpeed;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9f0436f919a77164da3e5047c1b7795f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: