using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class StartButton : MonoBehaviour {
    [SerializeField]
    GameObject obj;
    [SerializeField]
    Image Buttan;
    [SerializeField]
    Image Buttan2;
    int i;
    // Use this for initialization
    void Start()
    {
    }
	
	// Update is called once per frame
	void Update () {
	
	}

    public void StartOnClick() {
        Invoke("TimeS", 3);

        Vector3 pos = transform.position;
        for (int i = 0; i < 30; i++) {
            pos.x -= 5 * Time.deltaTime;
            Buttan.transform.position += pos;
            Buttan2.transform.position += pos;
        }


        obj.GetComponent<ColorFade>().Fadein(1.0f);

    }
    void TimeS() {
        //この中に遅延したい処理をいれるんちょ
        SceneManager.LoadScene("Main");
    }

}
