48 lines
1017 B
C#
48 lines
1017 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
|
|
public class CheckWInWorld : MonoBehaviour
|
|
{
|
|
public static bool finishedGame = false;
|
|
public static bool ended = false;
|
|
|
|
Animator WinPanel;
|
|
private int pointstoWin;
|
|
private int currentPoints;
|
|
public GameObject flagsContainer;
|
|
public AudioSource audio;
|
|
|
|
void Awake()
|
|
{
|
|
|
|
ended = false;
|
|
finishedGame = false;
|
|
pointstoWin = flagsContainer.transform.childCount;
|
|
GameControl.instance.StartedGame();
|
|
WinPanel = GameObject.Find("YouWinPanel").GetComponent<Animator>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void AddPoints()
|
|
{
|
|
currentPoints++;
|
|
if (currentPoints >= pointstoWin)
|
|
{
|
|
//transform.GetChild(0).gameObject.SetActive(true);
|
|
ended = true;
|
|
finishedGame = true;
|
|
win();
|
|
}
|
|
}
|
|
void win()
|
|
{
|
|
GameControl.instance.FinishGame();
|
|
}
|
|
}
|