mirror of
https://github.com/ConjureETS/PillowFight.git
synced 2026-03-25 17:40:59 +00:00
Added a light flicker
Signed-off-by: RosimInc <rosim_inc@hotmail.com>
This commit is contained in:
parent
a31eab5996
commit
c0ee9a7b78
@ -1,9 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 9264b7464f0b2a04d951cf9fbfef3019
|
|
||||||
folderAsset: yes
|
|
||||||
timeCreated: 1440262930
|
|
||||||
licenseType: Free
|
|
||||||
DefaultImporter:
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a982ca76f16291a469a3532007a4cb13
|
|
||||||
timeCreated: 1440262931
|
|
||||||
licenseType: Free
|
|
||||||
NativeFormatImporter:
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 8.6 KiB |
@ -1,55 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: d8eead0b348e6814d877c5d98b8fb4fa
|
|
||||||
timeCreated: 1440264201
|
|
||||||
licenseType: Free
|
|
||||||
TextureImporter:
|
|
||||||
fileIDToRecycleName: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
mipmaps:
|
|
||||||
mipMapMode: 0
|
|
||||||
enableMipMap: 1
|
|
||||||
linearTexture: 1
|
|
||||||
correctGamma: 0
|
|
||||||
fadeOut: 0
|
|
||||||
borderMipMap: 0
|
|
||||||
mipMapFadeDistanceStart: 1
|
|
||||||
mipMapFadeDistanceEnd: 3
|
|
||||||
bumpmap:
|
|
||||||
convertToNormalMap: 1
|
|
||||||
externalNormalMap: 1
|
|
||||||
heightScale: .25
|
|
||||||
normalMapFilter: 0
|
|
||||||
isReadable: 0
|
|
||||||
grayScaleToAlpha: 0
|
|
||||||
generateCubemap: 0
|
|
||||||
cubemapConvolution: 0
|
|
||||||
cubemapConvolutionSteps: 8
|
|
||||||
cubemapConvolutionExponent: 1.5
|
|
||||||
seamlessCubemap: 0
|
|
||||||
textureFormat: -1
|
|
||||||
maxTextureSize: 2048
|
|
||||||
textureSettings:
|
|
||||||
filterMode: -1
|
|
||||||
aniso: 2
|
|
||||||
mipBias: -1
|
|
||||||
wrapMode: -1
|
|
||||||
nPOTScale: 1
|
|
||||||
lightmap: 0
|
|
||||||
rGBM: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
spriteMode: 0
|
|
||||||
spriteExtrude: 1
|
|
||||||
spriteMeshType: 1
|
|
||||||
alignment: 0
|
|
||||||
spritePivot: {x: .5, y: .5}
|
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
spritePixelsToUnits: 100
|
|
||||||
alphaIsTransparency: 0
|
|
||||||
textureType: 1
|
|
||||||
buildTargetSettings: []
|
|
||||||
spriteSheet:
|
|
||||||
sprites: []
|
|
||||||
spritePackingTag:
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
BIN
Assets/Prefabs/Door Light.prefab
Normal file
BIN
Assets/Prefabs/Door Light.prefab
Normal file
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 11cc80c6443f5ea4190c0041d3858a7e
|
guid: cffa81ba5df21ac4f8d31f5bed357ce1
|
||||||
timeCreated: 1440263521
|
timeCreated: 1440275417
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
userData:
|
userData:
|
||||||
Binary file not shown.
@ -5,14 +5,28 @@ using System.Collections;
|
|||||||
public class LightOnOff : MonoBehaviour {
|
public class LightOnOff : MonoBehaviour {
|
||||||
|
|
||||||
private Light light;
|
private Light light;
|
||||||
|
private float intensity;
|
||||||
|
private float flicker;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
void Start () {
|
||||||
light = GetComponent<Light>();
|
light = GetComponent<Light>();
|
||||||
|
intensity = light.intensity;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update () {
|
void Update () {
|
||||||
|
|
||||||
|
flicker -= Time.deltaTime;
|
||||||
|
if (flicker <= 0)
|
||||||
|
{
|
||||||
|
light.intensity = intensity * 0.8f;
|
||||||
|
if (Random.value <= 0.3f)
|
||||||
|
flicker = Random.Range(0.4f, 1.5f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
light.intensity = intensity;
|
||||||
|
|
||||||
if(Input.GetKeyDown(KeyCode.Space))
|
if(Input.GetKeyDown(KeyCode.Space))
|
||||||
light.enabled = !light.enabled;
|
light.enabled = !light.enabled;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user