[TASK] Added main "game manager" to switch between the minigame and the map + added simple UI to show that a sticker was collected

This commit is contained in:
2019-08-28 01:11:46 +02:00
parent 9057c295da
commit c52392eacd
16 changed files with 2423 additions and 102 deletions

View File

@@ -0,0 +1,49 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
public class DuckCollectedScreen : MonoBehaviour
{
public DuckCollectedSuccessScreen successScreen;
public DuckCollectedFailedScreen failedScreen;
public event EventHandler screenCloseClicked;
public event EventHandler retryClicked;
private MiniGameResult _miniGameResult;
public MiniGameResult MiniGameResult
{
get => _miniGameResult;
set
{
_miniGameResult = value;
successScreen.gameObject.SetActive(value == MiniGameResult.Success);
failedScreen.gameObject.SetActive(value == MiniGameResult.Failed);
}
}
private DuckStickerData _collectedSticker;
public DuckStickerData CollectedSticker
{
get => _collectedSticker;
set
{
_collectedSticker = value;
successScreen.Sticker = value;
}
}
public void OnScreenCloseClicked()
{
screenCloseClicked?.Invoke(this, EventArgs.Empty);
}
public void OnRetryClicked()
{
retryClicked?.Invoke(this, EventArgs.Empty);
}
}