using UnityEngine;
using System.Collections;

public class GameManager : MonoBehaviour {

    public GameObject MyGlyph;

    public void SpwanGlyphs()
    {
    }

    void Awake()
    {
        GameStateController.Instance.GameStateChanged += Instance_GameStateChanged;
    }

    void Instance_GameStateChanged(EGameState oldState, EGameState newState)
    {
        if (newState == EGameState.TutoringGlyphs)
        {
            Glyph glyph = ((GameObject)Instantiate(MyGlyph, new Vector3(5.0f, 10.0f, 0.0f), Quaternion.identity)).GetComponent<Glyph>();
            glyph.setType(DamageType.Earth);
            glyph = ((GameObject)Instantiate(MyGlyph, new Vector3(9.0f, 10.0f, 0.0f), Quaternion.identity)).GetComponent<Glyph>();
            glyph.setType(DamageType.Fire);
        }
        if(newState == EGameState.Tutoring_Byebye)
        {
            Glyph glyph = ((GameObject)Instantiate(MyGlyph, new Vector3(5.0f, 10.0f, 0.0f), Quaternion.identity)).GetComponent<Glyph>();
            glyph.setType(DamageType.Wind);
            glyph = ((GameObject)Instantiate(MyGlyph, new Vector3(9.0f, 10.0f, 0.0f), Quaternion.identity)).GetComponent<Glyph>();
            glyph.setType(DamageType.Water);
            GameStateController.Instance.GameState = EGameState.Playing;
        }
    }

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
