Ejemplo n.º 1
0
    void Awake()
    {
        imageTargetBehaviour.AddEventListener(VoidAREvent.FIND, OnFind);
        videoObject = rawImage.gameObject;
        playButton.onClick.AddListener(OnPlayButtonClickHandler);
        var mVideoProgressBar = progressBar.GetComponent <VoidVideoProgressBar>();

        mVideoProgressBar.onValueChanged = OnValueChanged;
        playButton.transform.parent.gameObject.SetActive(false);
#if UNITY_EDITOR
        var videoPlayer = gameObject.AddComponent <UnityVideoPlayer>();
#else
        var videoPlayer = gameObject.AddComponent <VoidVideoPlayer>();
#endif
        videoPlayer.AddEventListener(VoidAREvent.READY, OnReady);
        videoPlayer.AddEventListener(VoidAREvent.END, OnComplete);
        vPlayer          = videoPlayer;
        rawImage.enabled = false;
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            rawImage.rectTransform.localScale = new Vector3(1, -1, 1);
        }
    }