当前位置: 首页>>代码示例>>C#>>正文


C# Texture.GetNativeTexturePtr方法代码示例

本文整理汇总了C#中UnityEngine.Texture.GetNativeTexturePtr方法的典型用法代码示例。如果您正苦于以下问题:C# Texture.GetNativeTexturePtr方法的具体用法?C# Texture.GetNativeTexturePtr怎么用?C# Texture.GetNativeTexturePtr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Texture的用法示例。


在下文中一共展示了Texture.GetNativeTexturePtr方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateSender

		public  bool UpdateSender(string sharingName, Texture tex)
		{
			if(enabled == false || gameObject.activeInHierarchy == false || _isInit == false)return false;
			//Debug.Log("Spout.UpdateSender:"+sharingName+"::"+tex.GetNativeTexturePtr().ToInt32());
			return updateSenderNative(sharingName, tex.GetNativeTexturePtr());
		}
开发者ID:benkuper,项目名称:SoftLove,代码行数:6,代码来源:Spout.cs

示例2: SetRemoteDisplayTexture

 public void SetRemoteDisplayTexture(Texture texture) {
   IntPtr texturePointer = texture.GetNativeTexturePtr();
   if (texturePointer == IntPtr.Zero) {
     Debug.LogError("Couldn't obtain native pointer for the remote display texture.");
     return;
   }
   CastRemoteDisplayiOSUnityBridge.SetRemoteDisplayTexture(texturePointer);
 }
开发者ID:Echoflyer,项目名称:RemoteDisplayUnitySample,代码行数:8,代码来源:CastRemoteDisplayiOSExtension.cs

示例3: ReplaceTexture

    public bool ReplaceTexture(long movieId, String textureName, Texture texture)
    {
        int texId;
        int rt_with     = texture.width;
        int rt_height    = texture.height;

#if (UNITY_4_0) || (UNITY_4_1)
#if UNITY_IPHONE
        texId = texture.GetNativeTextureID();
#else
        IntPtr texPtr = texture.GetNativeTexturePtr();
        texId = (int)(texPtr);
#endif
#else
        texId = texture.GetNativeTextureID();
#endif

        return SF_ReplaceTexture(movieId, textureName, texId, rt_with, rt_height);
    }
开发者ID:BiDuc,项目名称:Stereoscopic_Scatterplot,代码行数:19,代码来源:SFManager.cs

示例4: CreateSender

		public  bool CreateSender(string sharingName, Texture tex, int texFormat = 1)
		{
			if(!enabled)return false;
			if(!_isInit)return false;
			#if UNITY_EDITOR
			if(!Application.isPlaying && !_isEnabledInEditor ) return false;
			#endif
			//Debug.Log("Spout.CreateSender");
			//Debug.Log("Spout.CreateSender:"+sharingName+"::"+tex.GetNativeTexturePtr().ToInt32());
			bool result = createSenderNative(sharingName, tex.GetNativeTexturePtr(), texFormat);
			if (!result) Debug.LogWarning (String.Format("Spout sender creation with name {0} failed !",sharingName));
			if(result) {
				//Debug.Log (String.Format("Spout sender creation with name {0} success !",sharingName));
				localSenderNames.Add(sharingName);
			}
			return result;
		}
开发者ID:benkuper,项目名称:SoftLove,代码行数:17,代码来源:Spout.cs

示例5: SetRemoteDisplayTexture

 public void SetRemoteDisplayTexture(Texture texture)
 {
     IntPtr texturePointer = texture.GetNativeTexturePtr();
       if (texturePointer == IntPtr.Zero) {
     Debug.LogError("Couldn't obtain native pointer for the remote display texture.");
     return;
       }
       if (bridge != null) {
     Debug.Log("Setting texture with ID: " + texturePointer.ToInt64());
     bridge.CallStatic(NATIVE_SET_REMOTE_DISPLAY_TEXTURE, texturePointer.ToInt64());
       }
 }
开发者ID:googlecast,项目名称:RemoteDisplayUnitySample,代码行数:12,代码来源:CastRemoteDisplayAndroidExtension.cs

示例6: OnRenderObject

    void OnRenderObject()
    {
        // The overlay must be specified every eye frame, because it is positioned relative to the
        // current head location.  If frames are dropped, it will be time warped appropriately,
        // just like the eye buffers.
        if (Camera.current != Camera.main || Camera.current.cameraType != CameraType.Game || layerIndex == -1 || currentOverlayType == OverlayType.None)
            return;

        #if !UNITY_ANDROID || UNITY_EDITOR
        if (currentOverlayShape == OverlayShape.Cubemap || currentOverlayShape == OverlayShape.Cylinder)
        {
            Debug.LogWarning("Overlay shape " + currentOverlayShape + " is not supported on current platform");
        }
        #endif

        if (texture != cachedTexture)
        {
            cachedTexture = texture;
            if (cachedTexture)
                texNativePtr = cachedTexture.GetNativeTexturePtr();
        }

        if (cachedTexture == null || texNativePtr == IntPtr.Zero)
            return;

        if (currentOverlayShape == OverlayShape.Cubemap)
        {
            if (texture.GetType() != typeof(Cubemap))
            {
                Debug.LogError("Need Cubemap texture for cube map overlay");
                return;
            }
        }

        bool overlay = (currentOverlayType == OverlayType.Overlay);
        bool headLocked = false;
        for (var t = transform; t != null && !headLocked; t = t.parent)
            headLocked |= (t == Camera.current.transform);

        OVRPose pose = (headLocked) ? transform.ToHeadSpacePose() : transform.ToTrackingSpacePose();
        Vector3 scale = transform.lossyScale;
        for (int i = 0; i < 3; ++i)
            scale[i] /= Camera.current.transform.lossyScale[i];

        // Cylinder overlay sanity checking
        if (currentOverlayShape == OverlayShape.Cylinder)
        {
            float arcAngle = scale.x / scale.z / (float)Math.PI * 180.0f;
            if (arcAngle > 180.0f)
            {
                Debug.LogError("Cylinder overlay's arc angle has to be below 180 degree, current arc angle is " + arcAngle + " degree." );
                return ;
            }
        }

        bool isOverlayVisible = OVRPlugin.SetOverlayQuad(overlay, headLocked, texNativePtr, IntPtr.Zero, pose.flipZ().ToPosef(), scale.ToVector3f(), layerIndex, currentOverlayShape);
        if (rend)
            rend.enabled = !isOverlayVisible;
    }
开发者ID:ranguera,项目名称:tron-trails,代码行数:59,代码来源:OVROverlay.cs

示例7: Awake

 void Awake()
 {
     Debug.Log("Overlay Awake");
     rend = GetComponent<Renderer>();
     if (texture)
     {
         cachedTexture = texture;
         texNativePtr = texture.GetNativeTexturePtr();
     }
     else if (rend) // Backward compitability
     {
         texture = rend.material.mainTexture;
         cachedTexture = texture;
         texNativePtr = texture.GetNativeTexturePtr();
     }
 }
开发者ID:ranguera,项目名称:tron-trails,代码行数:16,代码来源:OVROverlay.cs

示例8: UpdateSender

	public static bool UpdateSender(string sharingName, Texture tex)
	{
		return updateSenderNative(sharingName, tex.GetNativeTexturePtr());
	}
开发者ID:ly774508966,项目名称:Kinect-Puppets-Unity,代码行数:4,代码来源:Spout2.cs

示例9: CreateSender

	public static bool CreateSender(string sharingName, Texture tex)
	{
		if(!isInit) Init();
		Debug.Log ("Tex Native Pointer :"+tex.GetNativeTexturePtr());
		return createSenderNative(sharingName, tex.GetNativeTexturePtr());
	}
开发者ID:ly774508966,项目名称:Kinect-Puppets-Unity,代码行数:6,代码来源:Spout2.cs


注:本文中的UnityEngine.Texture.GetNativeTexturePtr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。