using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Event_System : MonoBehaviour {
    public static Event_System instance;
    public float Score;
    int count = 0;
    public float Speed_limit = 2;
    public float Speed_Up_Every;
    public int Baby_Penguin_need = 2;
    public int medieam_Penguin_need = 3;
    public int Baby_Penguin_Count=0;
    public int Medieam_Penguin_Count=0;
    public int King_Penguin_Count=0;
    public bool Game_Over = false;
    public bool IsImmortal = false;
    public bool IsPause;
    public GameObject Score_Board;
    public AudioSource source;
    public AudioClip[] Sound_Effect;
    
    public Text Score_Text;
    public Text Score_Text2;

















    void Start () {
        instance = this;
        source = GetComponent<AudioSource>();
     
      
    }
	
	// Update is called once per frame
	void Update ()
    {
        /*Score_Text.text = "" + (int)Score;
        Score_Text2.text = "" + (int)Score;
        if (Game_Over == true)
        {
            Score_Board.SetActive(true);
            Score_Text.enabled = false;
        }
        else
        {
            Score_Board.SetActive(false);
            Score_Text.enabled = true;
        }

        if (Score_Board.active && count == 0)
        {*/
            //PlayeSound(7,2);
            count++;
        //}


       



        if (IsImmortal == true)
        {

            StartCoroutine(BacktoNormal());

        }
	}


    IEnumerator BacktoNormal()
    {
        
        yield return new WaitForSeconds(2);
        IsImmortal = false;
    }

    public void PlayeSound(int clip, float Volume)
    {

        source.PlayOneShot(Sound_Effect[clip], Volume);
       

    }

    

}
