POINTER_INFO.Copy C# (CSharp) Method

Copy() public method

public Copy ( POINTER_INFO, ptr ) : void
ptr POINTER_INFO,
return void
	public void Copy(POINTER_INFO ptr)
	{
		type = ptr.type;
		camera = ptr.camera;
		id = ptr.id;
		actionID = ptr.actionID;
		evt = ptr.evt;
		active = ptr.active;
		devicePos = ptr.devicePos;
		origPos = ptr.origPos;
		inputDelta = ptr.inputDelta;
		ray = ptr.ray;
		prevRay = ptr.prevRay;
		rayDepth = ptr.rayDepth;
		isTap = ptr.isTap;
		targetObj = ptr.targetObj;
		layerMask = ptr.layerMask;
		hitInfo = ptr.hitInfo;
		activeTime = ptr.activeTime;
	}

Usage Example

Example #1
0
	/// <summary>
	/// Detargets all pointers except the one with the specified ID.
	/// </summary>
	/// <param name="pointerID">The pointer to leave targetted.</param>
	public void DetargetAllExcept(int pointerID)
	{
		for (int j = 0; j < numActivePointers; ++j)
		{
			if (activePointers[j] != pointerID)
			{
				for (int i = 0; i < uiCameras.Length; ++i)
					if (uiCameras[i].camera != null && uiCameras[i].camera.gameObject.active)
					{
						if (pointers[i, activePointers[j]].targetObj != null)
						{
							// Gracefully release the current control:
							POINTER_INFO ptr = new POINTER_INFO();
							ptr.Copy(pointers[i, pointerID]);
							ptr.isTap = false;
							ptr.evt = POINTER_INFO.INPUT_EVENT.RELEASE_OFF;
							pointers[i, pointerID].targetObj.OnInput(ptr);

							pointers[i, activePointers[j]].targetObj = null;
						}
					}
			}
		}
	}