using UnityEngine;
using System.Collections;
using System;

public class TrocaFundo : MonoBehaviour {

	// Use this for initialization
	void Start () {
        GameObject fundo;
        
        print(transform.position.x + " " + transform.position.y);
        
        if (System.DateTime.Now.Hour >= 6 && System.DateTime.Now.Hour <= 20)
        {
            fundo = (GameObject)Instantiate(Resources.Load("dia"), transform.position, transform.rotation);
            print("Eh dia");
        }
        else
        {
            fundo = (GameObject)Instantiate(Resources.Load("noite"), transform.position, transform.rotation);
            print("Eh noite");
        }

        fundo.transform.SetParent(transform);

	}
	
	// Update is called once per frame
	void Update () {
	    
	}
}
