123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using UnityEngine;
- using System.Collections;
- public class MedaiPlayerSampleGUI : MonoBehaviour {
- public Camera VideoAd;
- public static MedaiPlayerSampleGUI Instance;
- public MediaPlayerCtrl scrMedia;
- public TextMesh GUIText;
- public GUIStyle style;
- public Sprite sprite;
- public float Timer = 10;
- public bool m_bFinish = false;
- public ScreenBase progressIndicator;
- void Start()
- {
- scrMedia.OnEnd += OnEnd;
- Instance = this;
- }
- void Update()
- {
- if (VideoAd.enabled)
- {
- Timer = Timer - Time.deltaTime;
- if (Timer <= 0)
- {
- Debug.Log("OnLeavingViewingVideoAd");
- MenuManager._instance.OnLeavingViewingVideoAd();
- }
- GUIText.text = ((int)Timer).ToString();
- }
- }
- void OnGUI()
- {
- if (VideoAd.enabled)
- {
- if (Timer <= 14)
- {
- if (GUI.Button(new Rect(10, 10, 100, 100), sprite.texture, style))
- {
- MenuManager._instance.OnLeavingViewingVideoAd();
- }
- }
-
- }
- }
- void OnEnd()
- {
- /*m_bFinish = true;
- Debug.Log("OnEnd");
- scrMedia.Stop();*/
- //MenuManager._instance.OnLeavingViewingVideoAd();
- }
- }
|