/** * 初始化录屏单例 * */ public static void Initialize() { if (Recnow.isSupported()) { if (RecnowInstance == null) { GameObject RecnowGameObject = new GameObject("Recnow"); if (RecnowGameObject != null) { RecnowInstance = RecnowGameObject.AddComponent <Recnow> (); DontDestroyOnLoad(RecnowGameObject); } } } }
void Start() { Recnow.setupAppId("2807"); Recnow.setupShareKeys("207799", "wx69c1efc9eb960a6c", "hello"); Recnow.didStart += recordDidStart; Recnow.didStop += recordDidStop; Recnow.didDiscard += recordDidDiscard; Recnow.videosPageViewShowing += testvideosPageViewShowing; Recnow.videosPageViewDisappear += testvideosPageViewDisappear; // cancle Recnow.videoEditingPageShowing += testvideoEditingshowing; Recnow.videoEditingPageDisappear += testvideoEditingDisappear; }
void OnGUI() { if (Recnow.isSupported()) { if (GUI.Button(new Rect(50, 50, 100, 100), "Start")) { Recnow.startRecording(true); Debug.Log("startrecord"); } if (GUI.Button(new Rect(250, 50, 100, 100), "Stop")) { Recnow.stopRecording(); Debug.Log("stoprecord"); } if (GUI.Button(new Rect(430, 50, 100, 100), "Videos")) { Recnow.showWorksView(); Debug.Log("mywork"); } } }
// Use this for initialization void Awake() { DontDestroyOnLoad(gameObject); // let Recnow Initialize Recnow.Initialize(); }