1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- using UnityEngine;
- using UnityEngine.UI;
- public class SCRtcMe
- {
- [DllImport("NativeCameraPlugin")]
- public static extern void SetTextureLocal(System.IntPtr texture);
- [DllImport("NativeCameraPlugin")]
- private static extern IntPtr GetLocalEventFunc();
- public string peerId;
- public string cId;
- public Texture2D tex;
- public string cIdV = "";
- public string cIdA = "";
- public int TextureID;
- public void updateTexture()
- {
- #if UNITY_ANDROID && !UNITY_EDITOR
- if (TextureID != 0)
- {
- GL.IssuePluginEvent(GetLocalEventFunc(), TextureID);
- }
- else
- {
- }
- #endif
- }
- public virtual void setMyCamera(Texture myRenderTexture)
- {
- #if UNITY_ANDROID && !UNITY_EDITOR
- TextureID = myRenderTexture.GetNativeTexturePtr().ToInt32();
- SetTextureLocal(myRenderTexture.GetNativeTexturePtr());
- #endif
- }
- }
|