Exemplo n.º 1
0
    //
    private void Awake()
    {
        //makes sure that callbacks are setup
        VTP.init();
        destroyed     = false;
        videoInstance = IntPtr.Zero;


        if (!VTP.checkIfVTPSupported())
        {
            this.enabled = false;
            return;
        }

        VideoInstance = createVideoTexture();
    }
Exemplo n.º 2
0
    private void Start()
    {
        if (!VTP.checkIfVTPSupported())
        {
            return;
        }

        if (!VideoTextureCacheContext.instance && !destroyed && Camera.main != null && Camera.main.gameObject != null)
        {
            Camera.main.gameObject.AddComponent <VideoTextureCacheContext>();
        }

        //init rendertexture
        setupRenderTex();
        //create VideoCacheData this is the unity 'instance'. this should only ever be created once per movie, in Start.
//		VideoInstance = createVideoTexture();
        //store this instance in manager for videoLoaded/videoEnded callbacks
        VTP.addInstance(this);

        //set the path to the movie, then call this.
        load();
    }