Skip to content

Commit

Permalink
Merge pull request #3 from uon-projects/paranoia-effect
Browse files Browse the repository at this point in the history
Bug-Fix for Paranoia effect
  • Loading branch information
teogor authored May 1, 2021
2 parents 8cdc8a3 + 2ec5f64 commit 72166a8
Show file tree
Hide file tree
Showing 13 changed files with 1,775 additions and 283 deletions.
8 changes: 4 additions & 4 deletions Assets/Materials/Flare/FlareBody.mat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Material:
m_PrefabAsset: {fileID: 0}
m_Name: FlareBody
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION _NORMALMAP
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
Expand All @@ -20,7 +20,7 @@ Material:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 8677871a5f891fb4e9fa94aa3fc18c18, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
Expand All @@ -40,7 +40,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 164a8ee6cbd11bc44ae0cebbbe950bd1, type: 3}
m_Texture: {fileID: 2800000, guid: 90f42daabc551494eae07b434d71dfdb, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
Expand Down Expand Up @@ -75,7 +75,7 @@ Material:
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.5849056, g: 0.18485224, b: 0.18485224, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
6 changes: 3 additions & 3 deletions Assets/Materials/Flare/FlareBodyGlas.mat
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Material:
m_PrefabAsset: {fileID: 0}
m_Name: FlareBodyGlas
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION
m_LightmapFlags: 1
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
Expand Down Expand Up @@ -76,7 +76,7 @@ Material:
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 0.4117647}
- _Color: {r: 1, g: 1, b: 1, a: 0.92156863}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static bl_SceneLoader GetLoader
{
get
{
bl_SceneLoader sl = GameObject.FindObjectOfType<bl_SceneLoader>();
var sl = GameObject.FindObjectOfType<bl_SceneLoader>();
if(sl == null)
{
Debug.LogWarning("Don't have any scene loader in this scene.");
Expand Down
14 changes: 7 additions & 7 deletions Assets/Plugins/Scripts/Items/FlareManage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class FlareManage : MonoBehaviour
[Range(1, 20)]
public int area = 2;
public GameObject player;
public ParanoiaSystem paranoiaSystem;
public ParanoiaHolder paranoiaHolder;

[Header("Mesh Render")]
public MeshRenderer objMeshRenderer;
Expand All @@ -47,7 +47,7 @@ public class FlareManage : MonoBehaviour
private int _time;
private string _id;
private Rigidbody _mRigidbody;
private bool _isParanoiaSystemNotNull;
private bool _isParanoiaHolderNotNull;

private void Start()
{
Expand All @@ -56,7 +56,7 @@ private void Start()
objMeshRenderer.shadowCastingMode = ShadowCastingMode.Off;
_id = AudioInstance.ID();
_mRigidbody = GetComponent<Rigidbody>();
_isParanoiaSystemNotNull = paranoiaSystem != null;
_isParanoiaHolderNotNull = paranoiaHolder != null;
}

private void Update()
Expand Down Expand Up @@ -88,9 +88,9 @@ private void Update()
var position = flareTransform.position;
var flarePos = new Vector3(position.x, playerPosition.y, position.z);
var distance = Vector3.Distance(playerPosition, flarePos);
if (_isParanoiaSystemNotNull)
if (_isParanoiaHolderNotNull)
{
paranoiaSystem.InsideSafeArea = distance <= area * 2;
paranoiaHolder.InsideSafeArea = distance <= area * 2;
}
if (_time < seconds * 60) return;

Expand All @@ -104,9 +104,9 @@ private void Update()
return;
}

if (_isParanoiaSystemNotNull)
if (_isParanoiaHolderNotNull)
{
paranoiaSystem.InsideSafeArea = false;
paranoiaHolder.InsideSafeArea = false;
}

if (!_isAttached) return;
Expand Down
4 changes: 2 additions & 2 deletions Assets/Plugins/Scripts/Override/VSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ private void Update()
{
// VSync must be disabled
QualitySettings.vSyncCount = 0;
// Set the frame rate to 45
Application.targetFrameRate = 45;
// Set the frame rate to 60 on all devices
Application.targetFrameRate = 60;
}
}
}
Loading

0 comments on commit 72166a8

Please sign in to comment.