mirror of
https://github.com/ConjureETS/DeathBook.git
synced 2026-03-24 04:20:58 +00:00
- Added the global awareness bar
This commit is contained in:
parent
c8fd3203a3
commit
2ce5fe16d8
@ -68,8 +68,8 @@ RectTransform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_AnchorMin: {x: .185000002, y: .147}
|
m_AnchorMin: {x: .150000006, y: .147}
|
||||||
m_AnchorMax: {x: .464206487, y: .5}
|
m_AnchorMax: {x: .850000024, y: .565513611}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: .5, y: .5}
|
m_Pivot: {x: .5, y: .5}
|
||||||
|
|||||||
@ -209,38 +209,6 @@ RectTransform:
|
|||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: .5, y: .5}
|
m_Pivot: {x: .5, y: .5}
|
||||||
--- !u!1 &142867287
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
serializedVersion: 4
|
|
||||||
m_Component:
|
|
||||||
- 224: {fileID: 142867288}
|
|
||||||
m_Layer: 5
|
|
||||||
m_Name: Content
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!224 &142867288
|
|
||||||
RectTransform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 142867287}
|
|
||||||
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: 1411243506}
|
|
||||||
m_RootOrder: 1
|
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
|
||||||
m_AnchorMax: {x: 1, y: .850000024}
|
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
|
||||||
m_Pivot: {x: .5, y: .5}
|
|
||||||
--- !u!1001 &255508666
|
--- !u!1001 &255508666
|
||||||
Prefab:
|
Prefab:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -330,7 +298,7 @@ Prefab:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 11414010, guid: c993e87661906234fba410e55ed66832, type: 2}
|
- target: {fileID: 11414010, guid: c993e87661906234fba410e55ed66832, type: 2}
|
||||||
propertyPath: m_Size
|
propertyPath: m_Size
|
||||||
value: 1
|
value: .999999881
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 22492032, guid: c993e87661906234fba410e55ed66832, type: 2}
|
- target: {fileID: 22492032, guid: c993e87661906234fba410e55ed66832, type: 2}
|
||||||
propertyPath: m_AnchorMin.x
|
propertyPath: m_AnchorMin.x
|
||||||
@ -400,6 +368,18 @@ Prefab:
|
|||||||
propertyPath: m_FontData.m_Alignment
|
propertyPath: m_FontData.m_Alignment
|
||||||
value: 4
|
value: 4
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11414010, guid: c993e87661906234fba410e55ed66832, type: 2}
|
||||||
|
propertyPath: m_Value
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11414010, guid: c993e87661906234fba410e55ed66832, type: 2}
|
||||||
|
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11414010, guid: c993e87661906234fba410e55ed66832, type: 2}
|
||||||
|
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
|
||||||
|
value: 2
|
||||||
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_ParentPrefab: {fileID: 100100000, guid: c993e87661906234fba410e55ed66832, type: 2}
|
m_ParentPrefab: {fileID: 100100000, guid: c993e87661906234fba410e55ed66832, type: 2}
|
||||||
m_IsPrefabParent: 0
|
m_IsPrefabParent: 0
|
||||||
@ -432,10 +412,10 @@ RectTransform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1411243506}
|
m_Father: {fileID: 1411243506}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_AnchorMin: {x: 0, y: .699999988}
|
m_AnchorMin: {x: .0500000007, y: .696616352}
|
||||||
m_AnchorMax: {x: 1, y: .925000012}
|
m_AnchorMax: {x: .949999988, y: .925000012}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: -3.05175781e-05, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: .5, y: .5}
|
m_Pivot: {x: .5, y: .5}
|
||||||
--- !u!114 &268520031
|
--- !u!114 &268520031
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@ -462,7 +442,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: Watchs
|
m_Text: Global Awareness
|
||||||
--- !u!222 &268520032
|
--- !u!222 &268520032
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -842,7 +822,7 @@ RectTransform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 122634401}
|
m_Father: {fileID: 122634401}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: .566316545, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: .224000007}
|
m_AnchorMax: {x: 1, y: .224000007}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
@ -1021,6 +1001,7 @@ GameObject:
|
|||||||
- 224: {fileID: 1411243506}
|
- 224: {fileID: 1411243506}
|
||||||
- 222: {fileID: 1411243508}
|
- 222: {fileID: 1411243508}
|
||||||
- 114: {fileID: 1411243507}
|
- 114: {fileID: 1411243507}
|
||||||
|
- 114: {fileID: 1411243509}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: WatchArea
|
m_Name: WatchArea
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -1039,7 +1020,8 @@ RectTransform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 268520030}
|
- {fileID: 268520030}
|
||||||
- {fileID: 142867288}
|
- {fileID: 1772384304}
|
||||||
|
- {fileID: 2112992426}
|
||||||
m_Father: {fileID: 122634401}
|
m_Father: {fileID: 122634401}
|
||||||
m_RootOrder: 5
|
m_RootOrder: 5
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
@ -1074,6 +1056,19 @@ CanvasRenderer:
|
|||||||
m_PrefabParentObject: {fileID: 0}
|
m_PrefabParentObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInternal: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1411243505}
|
m_GameObject: {fileID: 1411243505}
|
||||||
|
--- !u!114 &1411243509
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1411243505}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 292d41d787a32ef42aa6bc4f48643f9c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
AwarenessBar: {fileID: 1772384305}
|
||||||
|
Percentage: {fileID: 2112992427}
|
||||||
--- !u!1 &1728657168
|
--- !u!1 &1728657168
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1135,6 +1130,83 @@ CanvasRenderer:
|
|||||||
m_PrefabParentObject: {fileID: 0}
|
m_PrefabParentObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInternal: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1728657168}
|
m_GameObject: {fileID: 1728657168}
|
||||||
|
--- !u!1 &1772384303
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 163070, guid: c993e87661906234fba410e55ed66832, type: 2}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
serializedVersion: 4
|
||||||
|
m_Component:
|
||||||
|
- 224: {fileID: 1772384304}
|
||||||
|
- 222: {fileID: 1772384307}
|
||||||
|
- 114: {fileID: 1772384306}
|
||||||
|
- 114: {fileID: 1772384305}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: AwarenessBar
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &1772384304
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 22454288, guid: c993e87661906234fba410e55ed66832,
|
||||||
|
type: 2}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1772384303}
|
||||||
|
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: 1411243506}
|
||||||
|
m_RootOrder: 1
|
||||||
|
m_AnchorMin: {x: .0531043299, y: .215897292}
|
||||||
|
m_AnchorMax: {x: .566316485, y: .618000031}
|
||||||
|
m_AnchoredPosition: {x: 0, y: -.5}
|
||||||
|
m_SizeDelta: {x: 0, y: 1}
|
||||||
|
m_Pivot: {x: .5, y: .5}
|
||||||
|
--- !u!114 &1772384305
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 11476856, guid: c993e87661906234fba410e55ed66832,
|
||||||
|
type: 2}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1772384303}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 51e725985a0e317458c006132d935c25, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!114 &1772384306
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 11478634, guid: c993e87661906234fba410e55ed66832,
|
||||||
|
type: 2}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1772384303}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 2100000, guid: 085386af6af570a47b29380efacfa18d, type: 2}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_Sprite: {fileID: 21300000, guid: a023c2b27dbaaec45ae34c278711bc24, 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 &1772384307
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 22205402, guid: c993e87661906234fba410e55ed66832,
|
||||||
|
type: 2}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1772384303}
|
||||||
--- !u!1 &1858163984
|
--- !u!1 &1858163984
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1501,3 +1573,69 @@ Prefab:
|
|||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_ParentPrefab: {fileID: 100100000, guid: 136ea38d5deb4c9418beb879167d9b03, type: 2}
|
m_ParentPrefab: {fileID: 100100000, guid: 136ea38d5deb4c9418beb879167d9b03, type: 2}
|
||||||
m_IsPrefabParent: 0
|
m_IsPrefabParent: 0
|
||||||
|
--- !u!1 &2112992425
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
serializedVersion: 4
|
||||||
|
m_Component:
|
||||||
|
- 224: {fileID: 2112992426}
|
||||||
|
- 222: {fileID: 2112992428}
|
||||||
|
- 114: {fileID: 2112992427}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Percentage
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &2112992426
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2112992425}
|
||||||
|
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: 1411243506}
|
||||||
|
m_RootOrder: 2
|
||||||
|
m_AnchorMin: {x: .676841795, y: .150383666}
|
||||||
|
m_AnchorMax: {x: .911104441, y: .670410872}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: .5, y: .5}
|
||||||
|
--- !u!114 &2112992427
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2112992425}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1}
|
||||||
|
m_FontData:
|
||||||
|
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_FontSize: 14
|
||||||
|
m_FontStyle: 0
|
||||||
|
m_BestFit: 1
|
||||||
|
m_MinSize: 0
|
||||||
|
m_MaxSize: 40
|
||||||
|
m_Alignment: 4
|
||||||
|
m_RichText: 1
|
||||||
|
m_HorizontalOverflow: 0
|
||||||
|
m_VerticalOverflow: 0
|
||||||
|
m_LineSpacing: 1
|
||||||
|
m_Text: 100%
|
||||||
|
--- !u!222 &2112992428
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2112992425}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
|||||||
using SimpleJSON;
|
using SimpleJSON;
|
||||||
|
|
||||||
// Names generated from http://www.uinames.com
|
// Names generated from http://www.uinames.com
|
||||||
public class NameParser : MonoBehaviour
|
public class NameParser
|
||||||
{
|
{
|
||||||
private string[] maleFirstNames;
|
private string[] maleFirstNames;
|
||||||
private string[] femaleFirstNames;
|
private string[] femaleFirstNames;
|
||||||
|
|||||||
29
Assets/Scripts/WatchArea.cs
Normal file
29
Assets/Scripts/WatchArea.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
using DeathBook.Util;
|
||||||
|
using DeathBook.Model;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class WatchArea : MonoBehaviour, IObserver
|
||||||
|
{
|
||||||
|
public RatioProgression AwarenessBar;
|
||||||
|
public Text Percentage;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start ()
|
||||||
|
{
|
||||||
|
LevelManager.Instance.GameLevel.Subscribe(this);
|
||||||
|
UpdateBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Notify()
|
||||||
|
{
|
||||||
|
UpdateBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateBar()
|
||||||
|
{
|
||||||
|
AwarenessBar.SetCompletedRatio(LevelManager.Instance.GameLevel.Awareness);
|
||||||
|
Percentage.text = (int)Mathf.Clamp((LevelManager.Instance.GameLevel.Awareness * 100f / 0.6f), 0f, 100f) + "%";
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Assets/Scripts/WatchArea.cs.meta
Normal file
12
Assets/Scripts/WatchArea.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 292d41d787a32ef42aa6bc4f48643f9c
|
||||||
|
timeCreated: 1439755513
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
x
Reference in New Issue
Block a user