渲染

public GameObject mycube;

public Texture myTexture;//渲染图片

public MovieTexture tv;

void Update()

{

    mycube.transform.Translate(0.2f,0f,0f);

    if(mycube.transform.position.x >= 10f)

    {

        mycube.GetComponent().material.mainTexture = myTexture;

    }

    if(mycube.transform.position.x >= 20f)

    {

        mycube.GetComponent().enabled = false;

    }

}

你可能感兴趣的:(Unity3D)