123456789101112131415161718192021222324252627282930313233343536 |
- 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 int TextureID;
- public void updateTexture()
- {
- if (TextureID != 0)
- {
- GL.IssuePluginEvent(GetLocalEventFunc(), TextureID);
- }
- }
- public virtual void setMyCamera(RenderTexture myRenderTexture)
- {
- TextureID = myRenderTexture.GetNativeTexturePtr().ToInt32();
- SetTextureLocal(myRenderTexture.GetNativeTexturePtr());
- }
- }
|