1 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
29 changed files with 1516 additions and 3477 deletions

BIN
Assets/Images/LurchLoad.png (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,99 +0,0 @@
fileFormatVersion: 2
guid: 6670c15714c4db54a98fc9f850e092ff
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 7
mipmaps:
mipMapMode: 0
enableMipMap: 0
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: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
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: 1
spriteTessellationDetail: -1
textureType: 8
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
- serializedVersion: 2
buildTarget: Standalone
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

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

BIN
Assets/Models/StoneyBoye.blend (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,96 +0,0 @@
fileFormatVersion: 2
guid: ddf3da377e80bd64fbec2a9b0930f7d7
ModelImporter:
serializedVersion: 23
fileIDToRecycleName:
100000: //RootNode
400000: //RootNode
2100000: Material
2300000: //RootNode
3300000: //RootNode
4300000: Cube
7400000: Default Take
9500000: //RootNode
externalObjects: {}
materials:
importMaterials: 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: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
previousCalculatedGlobalScale: 1
hasPreviousCalculatedGlobalScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
importAnimation: 1
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 2
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

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

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 12fa2ee3da7cfc74492b3ca6d368347f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 25de82ce17d00ae44a4d430a0c69bef6 guid: b5f8c6ef1eb4bb846a5380eaf975ffa7
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

File diff suppressed because it is too large Load Diff

View File

@@ -351,128 +351,6 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &353969753 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 114123996009525022, guid: 8bcf2afca6664234f83b5ee8381b1975,
type: 2}
m_PrefabInternal: {fileID: 1187842046}
m_Script: {fileID: 11500000, guid: 9a548db4f33b8a24aa4ebca81f61e6dd, type: 3}
--- !u!1001 &546080828
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4034444186376736, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
propertyPath: m_LocalPosition.x
value: -1.1697227
objectReference: {fileID: 0}
- target: {fileID: 4034444186376736, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
propertyPath: m_LocalPosition.y
value: 4.084561
objectReference: {fileID: 0}
- target: {fileID: 4034444186376736, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
propertyPath: m_LocalPosition.z
value: -16.537073
objectReference: {fileID: 0}
- target: {fileID: 4034444186376736, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4034444186376736, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4034444186376736, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4034444186376736, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4034444186376736, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 114231797141046820, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: lurchScript
value:
objectReference: {fileID: 353969753}
- target: {fileID: 114907732206292950, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_Value
value: 0.3
objectReference: {fileID: 0}
- target: {fileID: 224827299162199612, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchorMin.x
value: 0.24000001
objectReference: {fileID: 0}
- target: {fileID: 224827299162199612, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchorMax.x
value: 0.44
objectReference: {fileID: 0}
- target: {fileID: 224190537634124508, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 224190537634124508, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -256.45
objectReference: {fileID: 0}
- target: {fileID: 224190537634124508, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_SizeDelta.y
value: 129.1
objectReference: {fileID: 0}
- target: {fileID: 224485806171950896, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 224485806171950896, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 224485806171950896, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -361.6
objectReference: {fileID: 0}
- target: {fileID: 224471551056386074, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 224471551056386074, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 224471551056386074, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -361.5
objectReference: {fileID: 0}
- target: {fileID: 224590447434586862, guid: 12fa2ee3da7cfc74492b3ca6d368347f,
type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1733452443825242, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 12fa2ee3da7cfc74492b3ca6d368347f, type: 2}
m_IsPrefabAsset: 0
--- !u!1 &793616625 --- !u!1 &793616625
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -560,68 +438,6 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1017672842
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1017672845}
- component: {fileID: 1017672844}
- component: {fileID: 1017672843}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1017672843
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1017672842}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &1017672844
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1017672842}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &1017672845
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1017672842}
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: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1187842046 --- !u!1001 &1187842046
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@@ -94,7 +94,6 @@ public class LurchMovement : MonoBehaviour {
if (lockMouse) if (lockMouse)
{ {
Cursor.lockState = CursorLockMode.Locked; Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
} }
else else
{ {

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

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1cef20558221ae14a83b89064e674720 guid: b614d5a678d653549b924deec5548458
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View File

@@ -1,96 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainMenue : MonoBehaviour {
[Header("Slider")]
public Scrollbar sliderAudio;
[Header("Buttons")]
public Button exitButton;
public Button playButton;
public string levelName;
[Header("Loading")]
public GameObject loadingStuff;
public RectTransform loadingIcon;
public GameObject finishedLoading;
// Use this for initialization
void Start () {
loadingStuff.SetActive(false);
finishedLoading.SetActive(false);
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Escape))
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}
Sliders();
Buttons();
}
void Sliders()
{
AudioListener.volume = sliderAudio.value;
}
void Buttons()
{
if (playButton)
{
playButton.onClick.AddListener(TaskLoadScene);
}
exitButton.onClick.AddListener(TaskExit);
}
void TaskExit()
{
Application.Quit();
}
void TaskLoadScene()
{
StartCoroutine(LoadScene());
}
IEnumerator LoadScene()
{
yield return null;
//Begin to load the Scene you specify
AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(levelName);
//Don't let the Scene activate until you allow it to
asyncOperation.allowSceneActivation = false;
Debug.Log("Pro :" + asyncOperation.progress);
//When the load is still in progress, output the Text and progress bar
while (!asyncOperation.isDone)
{
loadingStuff.SetActive(true);
float rotPlus = 0.0f;
rotPlus -= 0.03f;
loadingIcon.Rotate(new Vector3(0, 0, rotPlus));
if (asyncOperation.progress >= 0.9f)
{
finishedLoading.SetActive(true);
if (Input.GetKeyDown(KeyCode.Space))
{
asyncOperation.allowSceneActivation = true;
}
}
yield return null;
}
}
}

View File

@@ -1,16 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OptionsMenu : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}

View File

@@ -1,79 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
using UnityEngine.SceneManagement;
public class OptionsMenue : MonoBehaviour {
[Header("Basics")]
public GameObject optionsMenue;
public LurchMovement lurchScript;
[Header("Slider")]
public Scrollbar sliderSensitivity;
public Scrollbar sliderAudio;
[Header("Buttons")]
public Button exitButton;
public Button resumeButton;
public Button playButton;
public string levelName;
// Use this for initialization
void Start () {
optionsMenue.SetActive(false);
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Escape))
{
optionsMenue.SetActive(true);
if (lurchScript) {
lurchScript.enabled = false;
}
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}
Sliders();
Buttons();
}
void Sliders()
{
lurchScript.mouseSensitivity = sliderSensitivity.value * 4;
AudioListener.volume = sliderAudio.value;
}
void Buttons()
{
if (resumeButton) {
resumeButton.onClick.AddListener(TaskResume);
}
if (playButton)
{
playButton.onClick.AddListener(TaskLoadScene);
}
exitButton.onClick.AddListener(TaskExit);
}
void TaskResume()
{
lurchScript.enabled =true;
optionsMenue.SetActive(false);
}
void TaskExit()
{
Application.Quit();
}
void TaskLoadScene()
{
SceneManager.LoadScene(levelName);
}
}

View File

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

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 4ab73a99d8466b442bc9626a10e51342 guid: b8b7c82b907af1c45a4d5abd120ab492
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

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

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 24dcdb215c8fed5408db771f2fc46159 guid: 9f0436f919a77164da3e5047c1b7795f
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View File

@@ -5,9 +5,6 @@ EditorBuildSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 2 serializedVersion: 2
m_Scenes: m_Scenes:
- enabled: 1
path: Assets/Scenes/MainMenu.unity
guid: 25de82ce17d00ae44a4d430a0c69bef6
- enabled: 1 - enabled: 1
path: Assets/Scenes/SampleScene.unity path: Assets/Scenes/SampleScene.unity
guid: 99c9720ab356a0642a771bea13969a05 guid: 99c9720ab356a0642a771bea13969a05

View File

@@ -35,8 +35,6 @@ GraphicsSettings:
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: [] m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0} type: 0}

View File

@@ -3,7 +3,7 @@
--- !u!310 &1 --- !u!310 &1
UnityConnectSettings: UnityConnectSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_Enabled: 1 m_Enabled: 0
m_TestMode: 0 m_TestMode: 0
m_TestEventUrl: m_TestEventUrl:
m_TestConfigUrl: m_TestConfigUrl: