Fading Object in and out with timer

Hello,

I have a fast scene that plays and with objects I want to fade in and out at different times…

Simple Right…?

But I’m missing it . Here is my script:

using UnityEngine;
using System.Collections;

public class timer : MonoBehaviour {


    public string next;
    public float time = 8.0f;
    public float time2= 26.0f;
    public float time3= 45.0f;

    public GameObject One;
    public GameObject Two;

    public float oneAlpha = 0.0f;
    public float twoAlpha = 0.0f;


    // Use this for initialization
    void Start () {
        StartCoroutine("Wait");
	}
	


 



IEnumerator Wait()
    {
        if(WaitForSeconds(time))
        {
            One.GetComponent<Renderer>().material.color = new Vector4(0, 0, 0, oneAlpha);
        }

        if (WaitForSeconds(time2))
        {
            Two.GetComponent<Renderer>().material.color = new Vector4(0, 0, 0, twoAlpha);
        }

        if (WaitForSeconds(time3))
        {
                Application.LoadLevel(next);
        }
           
    }	
	
}

public class NewBehaviourScript : MonoBehaviour {
public GameObject dude;//here is your object
public float alpha;
public bool sw;
public Color dudescolor;
// Use this for initialization
void Start () {
//must have a transparent shader To work !!!
dude.GetComponent().material.shader=Shader.Find(“Transparent/Diffuse”);
//lets remember the color we started with!!!
dudescolor =dude.GetComponent().material.color;

	}
	

	void Update () {
            //play with our float a little bit
		if (sw){alpha+=Time.deltaTime;
			if(alpha>1){sw=!sw;}}
		if(!sw){alpha+=-Time.deltaTime;
			if(alpha<0){sw=!sw;}}

            //assign the float to your gameobjects alpha!!!
		dudescolor.a = alpha;
		dude.GetComponent<Renderer>().material.color = dudescolor;
	}
}

this is a working example of fading color!
im not sure when or how you want to change it but this should include example of everything you need!!! Void update changes ever frame. so use it to change a float a little bit every frame and apply it to a the alpha channel of your color. dont use vector4. use a Color variable instead. and color.a is the alpha channel you are looking for!