Exemple #1
0
 private void ClickD(FCommonBt bt)
 {
     nLogButtone[1].nBtEvent = ClickO;
 }
Exemple #2
0
 private void ClickO(FCommonBt bt)
 {
     MyLog.SetLog();
 }
        public override void Init(params object[] o)
        {
            //SetVideoTime("Video01", 0,7.43f);
            //SetVideoTime("Video02", 7.43f,11.43f);
            //SetVideoTime("Video03", 11.43f,15.31f);
            //SetVideoTime("Video04", 15.31f,23.48f);
            //SetVideoTime("Video05", 23.48f,28.14f);
            //SetVideoTime("Video06", 28.14f,36.36f);
            //SetVideoTime("Video07", 36.36f,41.48f);

            SceneManager.instance.StopSound(SceneManager.MianMusicGroup);

            SetVideoTime("Video01", 1, 8.2f);
            SetVideoTime("Video02", 9.1f, 16.0f);
            SetVideoTime("Video02_1", 17.0f, 29.0f);
            SetVideoTime("Video03", 30.0f, 38.5f);
            SetVideoTime("Video03_1", 38.6f, 46.23f);
            SetVideoTime("Video04", 47.1f, 57.5f);
            SetVideoTime("Video04_1", 57.6f, 63.2f);
            SetVideoTime("Video05", 64.0f, 71.0f);
            SetVideoTime("Video06", 72.0f, 77.07f);
            SetVideoTime("Video06_1", 78.0f, 84.07f);
            SetVideoTime("Video07", 85.1f, 90.0f);

            string videoName = (string)o[0];

            mVideoPlayer               = mMainPlane.GetFObject <VideoPlayer>("F_VideoPlayer");
            mImage                     = mMainPlane.GetFObject <RawImage>("F_RawImage");
            newTexture                 = new RenderTexture(512, 512, 16, RenderTextureFormat.ARGB32);
            newTexture.name            = "video" + GetInstanceID();
            newTexture.isPowerOfTwo    = true;
            newTexture.hideFlags       = HideFlags.DontSave;
            mImage.texture             = newTexture;
            mVideoPlayer.targetTexture = newTexture;
            var v = mImage.rectTransform.sizeDelta;

            v.y = mImage.rectTransform.rect.width * 1024 / 768;
            mImage.rectTransform.sizeDelta = v;
            //VideoClip clipv = FEngineManager.LoadPrefab<VideoClip>(videoName);
            //mVideoPlayer.clip = clipv;
            mSource = mVideoPlayer.GetComponent <AudioSource>();
            mVideoPlayer.SetTargetAudioSource(0, mSource);
            mVideoPlayer.Play();
            mVideoPlayer.errorReceived += (f, t) =>
            {
                Debug.LogError(t);
                CloseMySelf();
            };
            mVideoPlayer.loopPointReached += (f) =>
            {
                if (!mSkiping)
                {
                    StartCoroutine(PlayFun());
                }
            };

            mSkipBt = mMainPlane.GetFObject <FCommonBt>("F_Skip");
            mSkipBt.gameObject.SetActive(true);
            mSkipBt.nBtEvent = (f) =>
            {
                if (!mSkiping)
                {
                    StartCoroutine(PlayFun());
                }
            };
            mDec      = mMainPlane.GetFObject <Text>("F_Dec");
            mDec.text = "";
        }