65 lines
1.7 KiB
C#
65 lines
1.7 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class GameFinished1 : MonoBehaviour, IDataPresistence
|
|
{
|
|
public Damageable NPClife1;
|
|
public Damageable NPClife2;
|
|
public Damageable NPClife3;
|
|
|
|
public Test test;
|
|
|
|
public GameData gameData;
|
|
|
|
public Button pauseButtonUI;
|
|
|
|
public DataPresistenceManager presistenceManager;
|
|
|
|
public GameObject finishPanel;
|
|
public GameObject movementBlock;
|
|
|
|
int jawaban1;
|
|
int jawaban2;
|
|
int jawaban3;
|
|
|
|
private void OnTriggerEnter2D(Collider2D collision)
|
|
{
|
|
if (!NPClife1.IsAlive && !NPClife2.IsAlive && !NPClife3.IsAlive)
|
|
{
|
|
for (int i = 0; i < test.collectedJawaban.Count; i++)
|
|
{
|
|
int item = test.collectedJawaban[i];
|
|
if (i == 0)
|
|
{
|
|
jawaban1 = item;
|
|
Debug.Log("Jawaban 1: " + jawaban1);
|
|
}
|
|
else if (i == 1)
|
|
{
|
|
jawaban2 = item;
|
|
Debug.Log("Jawaban 2: " + jawaban2);
|
|
}
|
|
else if (i == 2)
|
|
{
|
|
jawaban3 = item;
|
|
Debug.Log("Jawaban 3: " + jawaban3);
|
|
}
|
|
}
|
|
presistenceManager.FinishQuitGame();
|
|
pauseButtonUI.gameObject.SetActive(false);
|
|
finishPanel.SetActive(true);
|
|
movementBlock.SetActive(true);
|
|
}
|
|
}
|
|
|
|
public void LoadData(GameData data) {}
|
|
|
|
public void SaveData(ref GameData data)
|
|
{
|
|
data.jawaban1Game1 = jawaban1;
|
|
data.jawaban2Game1 = jawaban2;
|
|
data.jawaban3Game1 = jawaban3;
|
|
data.game2 = true;
|
|
}
|
|
}
|