Exemplo n.º 1
0
        protected virtual void Awake()
        {
            decoder        = GetComponent <MediaDecoder>();
            gameController = FindObjectOfType <GameController>();

            //isInitialized = false;
            oriScale      = transform.localScale;
            isInitialized = true;
            //onInitComplete.Invoke();
            if (!isInitialized)
            {
                Debug.Log(LOG_TAG + " not initialized.");
                return;
            }

            if (isAdaptToResolution)
            {
                decoder.onInitComplete.AddListener(adaptResolution);
            }
            decoder.onInitComplete.AddListener(decoder.startDecoding);
            // forcing pause after init !!!
            decoder.onInitComplete.AddListener(decoder.setPause);
            decoder.onInitComplete.AddListener(delegate { gameController.VidInitCompleted(videoName); });
            decoder.onInitComplete.AddListener(decoder.onInitComplete.RemoveAllListeners);
            decoder.onVideoEnd.AddListener(delegate { gameController.OnMediaDecoderVidEnd(videoName); });
        }
Exemplo n.º 2
0
 protected virtual void Start()
 {
     decoder = GetComponent <MediaDecoder>();
     initFileSeeker();
 }