@@ -19,8 +19,8 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 4989710692855914}
- component: {fileID: 114451189923487356}
- component: {fileID: 114732676040427802}
- component: {fileID: 114499334362239426}
- component: {fileID: 114111180759700762}
m_Layer: 0
m_Name: UI
m_TagString: Untagged
@@ -234,6 +234,23 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1482867234851844
GameObject:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224050423566672000}
- component: {fileID: 222792861771380112}
- component: {fileID: 114528210304710934}
m_Layer: 5
m_Name: GameEnd
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &1510757916697888
GameObject:
m_ObjectHideFlags: 1
@@ -334,6 +351,23 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &1739863603203452
GameObject:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224983524240243580}
- component: {fileID: 222446008568543984}
- component: {fileID: 114903931403566428}
m_Layer: 5
m_Name: TextMeshPro Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1763222201377438
GameObject:
m_ObjectHideFlags: 1
@@ -888,6 +922,20 @@ MonoBehaviour:
m_PostInfinity: 2
m_RotationOrder: 4
speed: 0
--- !u!114 &114111180759700762
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1014865802018532}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!114 &114122279230957936
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -1447,20 +1495,6 @@ MonoBehaviour:
m_PostInfinity: 2
m_RotationOrder: 4
speed: 0
--- !u!114 &114451189923487356
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1014865802018532}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!114 &114476160930035180
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -1499,6 +1533,24 @@ MonoBehaviour:
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &114499334362239426
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1014865802018532}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &114507246204161318
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -1542,6 +1594,33 @@ MonoBehaviour:
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114528210304710934
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1482867234851844}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 6dd67fc850a43d94ebc92cccb5406b17, type: 3}
m_Type: 0
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114583884038515346
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -1688,24 +1767,6 @@ MonoBehaviour:
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114732676040427802
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1014865802018532}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &114808839243753412
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -1830,6 +1891,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 120c4eb3a2f538b40a38c5d758d541b7, type: 3}
m_Name:
m_EditorClassIdentifier:
_GameEndWidget: {fileID: 1482867234851844}
--- !u!114 &114883418899219564
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -1970,6 +2032,121 @@ MonoBehaviour:
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &114903931403566428
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1739863603203452}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_text: 'click to restart
'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 72
m_fontSizeBase: 72
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_textAlignment: 258
m_isAlignmentEnumConverted: 1
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 114903931403566428}
characterCount: 17
spriteCount: 0
spaceCount: 3
wordCount: 3
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_havePropertiesChanged: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_isInputParsingRequired: 1
m_inputSource: 0
m_hasFontAssetChanged: 0
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &114915838435717700
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -2180,6 +2357,13 @@ CanvasRenderer:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1451657229385300}
m_CullTransparentMesh: 0
--- !u!222 &222446008568543984
CanvasRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1739863603203452}
m_CullTransparentMesh: 0
--- !u!222 &222471014522552034
CanvasRenderer:
m_ObjectHideFlags: 1
@@ -2250,6 +2434,13 @@ CanvasRenderer:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1913124237465356}
m_CullTransparentMesh: 0
--- !u!222 &222792861771380112
CanvasRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1482867234851844}
m_CullTransparentMesh: 0
--- !u!222 &222869612028383656
CanvasRenderer:
m_ObjectHideFlags: 1
@@ -2387,6 +2578,25 @@ RectTransform:
m_AnchoredPosition: {x: -20, y: -60}
m_SizeDelta: {x: 300, y: 350}
m_Pivot: {x: 0, y: 1}
--- !u!224 &224050423566672000
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1482867234851844}
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:
- {fileID: 224983524240243580}
m_Father: {fileID: 224694414606445624}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1000, y: 800}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224067130081606282
RectTransform:
m_ObjectHideFlags: 1
@@ -2666,6 +2876,7 @@ RectTransform:
- {fileID: 224757131547866212}
- {fileID: 224502865883502600}
- {fileID: 224030233325484230}
- {fileID: 224050423566672000}
m_Father: {fileID: 4989710692855914}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -2781,7 +2992,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: -100}
m_SizeDelta: {x: 400, y: 300}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224937678636475190
@@ -2839,3 +3050,21 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!224 &224983524240243580
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1739863603203452}
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: 224050423566672000}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -400}
m_SizeDelta: {x: 600, y: 84.79}
m_Pivot: {x: 0.5, y: 0.5}
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class ObjectiveManager : BaseManager<ObjectiveManager> {

@@ -31,11 +32,13 @@ public class SRecipeScore
#endregion // ATTRIBUTES

public static event Action OnGameStarted;
public static event Action OnGameEnded;
public static event Action<Recipes.SRecipe> OnRecipeChanged;
public static event Action<SRecipeScore> OnRecipeShipped;
public static event Action OnRecipeInterlude;

private bool _gameStarted = false;
private bool _gameEnded = false;
private bool _firstRecipeReceived = false;
private bool _alreadyShipped = false;

@@ -51,7 +54,13 @@ public override void OnStartGame()

public override void OnUpdateManager(float deltaTime)
{
if (!_gameStarted)
// Restart game
if (_gameEnded && Input.GetMouseButtonDown(0))
{
SceneManager.LoadScene("Main");
}

if (!_gameStarted || _gameEnded)
{
return;
}
@@ -163,7 +172,8 @@ public void ShipRecipe()

public void GameEnd()
{
// TODO
Debug.Log("Game Over");
_gameEnded = true;

if (OnGameEnded != null) OnGameEnded();
}
}
@@ -1,14 +1,27 @@
using UnityEngine;
using UnityEngine.UI;

public class HUDWidget : MonoBehaviour {

#region ATTRIBUTES

public GameObject _GameEndWidget;

#endregion // ATTRIBUTES

public void Start()
{
ObjectiveManager.OnGameStarted += OnGameStarted;
ObjectiveManager.OnGameEnded += OnGameEnded;
}

public void OnGameStarted()
{
GetComponent<Canvas>().enabled = true;
}

public void OnGameEnded()
{
_GameEndWidget.SetActive(true);
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.