From eeccb27de363069b65a6dd0490f41109bb05e1d3 Mon Sep 17 00:00:00 2001 From: Patrice Vignola Date: Sun, 8 Nov 2015 08:26:23 -0500 Subject: [PATCH] Add the flickering light --- Assets/Scenes/PatScene.unity | 16 ++++++++++++++++ Assets/Scripts/FlickeringLight.cs | 25 +++++++++++++++---------- ProjectSettings/ProjectSettings.asset | 22 ++-------------------- ProjectSettings/ProjectVersion.txt | 2 +- 4 files changed, 34 insertions(+), 31 deletions(-) diff --git a/Assets/Scenes/PatScene.unity b/Assets/Scenes/PatScene.unity index 5fa2c0c..1432984 100644 --- a/Assets/Scenes/PatScene.unity +++ b/Assets/Scenes/PatScene.unity @@ -518,6 +518,7 @@ GameObject: - 4: {fileID: 1925818717} - 33: {fileID: 1925818719} - 23: {fileID: 1925818718} + - 114: {fileID: 1925818720} m_Layer: 0 m_Name: ligther m_TagString: Untagged @@ -569,6 +570,21 @@ MeshFilter: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1925818716} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1925818720 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1925818716} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 761710753b6561d4f9a0d6e56483a328, type: 3} + m_Name: + m_EditorClassIdentifier: + PointLight: {fileID: 1772031535} + MinIntensity: .699999988 + MaxIntensity: 1 + FlickeringSpeed: 20 --- !u!1 &1938686768 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/FlickeringLight.cs b/Assets/Scripts/FlickeringLight.cs index dada50c..4870ff8 100644 --- a/Assets/Scripts/FlickeringLight.cs +++ b/Assets/Scripts/FlickeringLight.cs @@ -1,15 +1,20 @@ using UnityEngine; using System.Collections; -public class FlickeringLight : MonoBehaviour { +public class FlickeringLight : MonoBehaviour +{ + public Light PointLight; + public float MinIntensity = 0.5f; + public float MaxIntensity = 0.7f; + public float FlickeringSpeed = 20f; + + void Update () + { + float range = MaxIntensity - MinIntensity; + float AverageIntensity = MinIntensity + range / 2; - // Use this for initialization - void Start () { - - } - - // Update is called once per frame - void Update () { - - } + Debug.Log(Mathf.Sin(Time.timeSinceLevelLoad)); + + PointLight.intensity = Random.Range(MinIntensity, MaxIntensity); + } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 21f7840..ba6dcbb 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -8,7 +8,6 @@ PlayerSettings: defaultScreenOrientation: 4 targetDevice: 2 targetResolution: 0 - useOnDemandResources: 0 accelerometerFrequency: 60 companyName: DefaultCompany productName: EscapeTheRoom @@ -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} @@ -163,10 +152,8 @@ PlayerSettings: m_BuildTargetIcons: - m_BuildTarget: m_Icons: - - serializedVersion: 2 - m_Icon: {fileID: 0} - m_Width: 0 - m_Height: 0 + - m_Icon: {fileID: 0} + m_Size: 0 m_BuildTargetBatching: [] m_BuildTargetGraphicsAPIs: [] webPlayerTemplate: APPLICATION:Default @@ -241,8 +228,6 @@ PlayerSettings: ps4SdkOverride: ps4BGMPath: ps4ShareFilePath: - ps4ShareOverlayImagePath: - ps4PrivacyGuardImagePath: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 ps4RemotePlayKeyMappingDir: @@ -260,13 +245,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: diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index b11ab9b..e040c5c 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 5.2.2f1 +m_EditorVersion: 5.2.0f3 m_StandardAssetsVersion: 0