From 1f79a2b15eadb6b6ae6bdcc76d257e2db2af5bb1 Mon Sep 17 00:00:00 2001 From: Patrice Vignola Date: Sun, 16 Aug 2015 19:01:15 -0400 Subject: [PATCH] - Added the logo and fixed the global awareness bar --- Assets/Resources/slaughterLogo.png.meta | 14 +++--- Assets/Scenes/Gameplay.unity | 64 ++++++++++++++++++++++++- Assets/Scripts/PersonNode.cs | 2 - Assets/Scripts/WatchArea.cs | 6 ++- 4 files changed, 74 insertions(+), 12 deletions(-) diff --git a/Assets/Resources/slaughterLogo.png.meta b/Assets/Resources/slaughterLogo.png.meta index f536eab..fab1024 100644 --- a/Assets/Resources/slaughterLogo.png.meta +++ b/Assets/Resources/slaughterLogo.png.meta @@ -26,26 +26,26 @@ TextureImporter: cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 - textureFormat: -1 + textureFormat: -3 maxTextureSize: 2048 textureSettings: filterMode: -1 - aniso: -1 + aniso: 16 mipBias: -1 - wrapMode: -1 - nPOTScale: 1 + wrapMode: 1 + nPOTScale: 0 lightmap: 0 rGBM: 0 compressionQuality: 50 - spriteMode: 0 + spriteMode: 1 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 + alphaIsTransparency: 1 + textureType: 8 buildTargetSettings: [] spriteSheet: sprites: [] diff --git a/Assets/Scenes/Gameplay.unity b/Assets/Scenes/Gameplay.unity index 85020f1..ce08fc7 100644 --- a/Assets/Scenes/Gameplay.unity +++ b/Assets/Scenes/Gameplay.unity @@ -383,6 +383,67 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: c993e87661906234fba410e55ed66832, type: 2} m_IsPrefabParent: 0 +--- !u!1 &256633603 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 256633604} + - 222: {fileID: 256633606} + - 114: {fileID: 256633605} + m_Layer: 5 + m_Name: Logo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &256633604 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 256633603} + 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: 1858163985} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: .0500000007} + m_AnchorMax: {x: .182673752, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: .5, y: .5} +--- !u!114 &256633605 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 256633603} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Sprite: {fileID: 21300000, guid: eaaa90877e079004eb38be08a3e86db7, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &256633606 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 256633603} --- !u!1 &268520029 GameObject: m_ObjectHideFlags: 0 @@ -1233,7 +1294,8 @@ RectTransform: 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_Children: + - {fileID: 256633604} m_Father: {fileID: 750965895} m_RootOrder: 0 m_AnchorMin: {x: 0, y: .899999976} diff --git a/Assets/Scripts/PersonNode.cs b/Assets/Scripts/PersonNode.cs index 24b67ca..144ddc7 100644 --- a/Assets/Scripts/PersonNode.cs +++ b/Assets/Scripts/PersonNode.cs @@ -223,8 +223,6 @@ public class PersonNode : MonoBehaviour, IObserver { if (!_model.Alive) return; - Debug.Log(_model.Alive); - _holdDuration += Time.deltaTime; xMarkLeft.SetCompletedRatio(Mathf.Clamp(_holdDuration - 0.025f, 0f, 1f)); diff --git a/Assets/Scripts/WatchArea.cs b/Assets/Scripts/WatchArea.cs index fa49772..2250868 100644 --- a/Assets/Scripts/WatchArea.cs +++ b/Assets/Scripts/WatchArea.cs @@ -23,7 +23,9 @@ public class WatchArea : MonoBehaviour, IObserver private void UpdateBar() { - AwarenessBar.SetCompletedRatio(LevelManager.Instance.GameLevel.Awareness); - Percentage.text = (int)Mathf.Clamp((LevelManager.Instance.GameLevel.Awareness * 100f / 0.6f), 0f, 100f) + "%"; + float adjustedRatio = Mathf.Clamp((LevelManager.Instance.GameLevel.Awareness / 0.6f), 0f, 1f); + + AwarenessBar.SetCompletedRatio(adjustedRatio); + Percentage.text = (int)(adjustedRatio * 100f) + "%"; } }