internal void create(Location location, SurfaceRectangle localSurface, SurfaceRectangle remoteSurfaceProxy, float length) { _handheldListener = new UDPHandheldListener(int.Parse(_properties.localSetupInfo.receiveHandheldPort), "negativespace"); _location = location; _localSurface = localSurface; _remoteSurfaceProxy = remoteSurfaceProxy; _negativeSpaceLength = length; _createNegativeSpaceMesh(); NegativeSpaceCenter = new GameObject("NegativeSpaceCenter"); NegativeSpaceCenter.transform.position = (_localSurface.SurfaceBottomLeft + _remoteSurfaceProxy.SurfaceTopRight) * 0.5f; NegativeSpaceCenter.transform.rotation = GameObject.Find("localScreenCenter").transform.rotation; _log.WriteLine(this, "Waiting for handheld at " + _properties.localSetupInfo.receiveHandheldPort); _log.WriteLine(this, "Negative Space Created for Location " + _location + " with length " + _negativeSpaceLength); _handCursor = new GameObject("HandCursor"); _handCursor.transform.position = Vector3.zero; _handCursor.transform.rotation = Quaternion.identity; _handCursor.transform.parent = _main.LocalOrigin.transform; _handCursor.AddComponent <NegativeSpaceCursor>(); _spaceCreated = true; }
void Start() { NSProperties p = GameObject.Find("Main").GetComponent <NSProperties>(); handheldListenPort = p.handheld_Port; _handheldListener = new UDPHandheldListener(handheldListenPort, DecryptKey); }
internal void create(Location location, SurfaceRectangle localSurface, SurfaceRectangle remoteSurfaceProxy, float length) { _handheldListener = new UDPHandheldListener(int.Parse(_properties.localSetupInfo.receiveHandheldPort)); Debug.Log(this.ToString() + ": Receiving Handheld data in " + _properties.localSetupInfo.receiveHandheldPort); _location = location; _localSurface = localSurface; _remoteSurfaceProxy = remoteSurfaceProxy; _negativeSpaceLength = length; //_createNegativeSpaceMesh(); _negativeSpaceWalls("bottomWall", _localSurface.SurfaceBottomLeft, _localSurface.SurfaceBottomRight, _remoteSurfaceProxy.SurfaceBottomRight, _remoteSurfaceProxy.SurfaceBottomLeft); _negativeSpaceWalls("leftWall", _localSurface.SurfaceBottomLeft, _remoteSurfaceProxy.SurfaceBottomLeft, _remoteSurfaceProxy.SurfaceTopLeft, _localSurface.SurfaceTopLeft); _negativeSpaceWalls("rightWall", _remoteSurfaceProxy.SurfaceBottomRight, _localSurface.SurfaceBottomRight, _localSurface.SurfaceTopRight, _remoteSurfaceProxy.SurfaceTopRight); _negativeSpaceWalls("topWall", _remoteSurfaceProxy.SurfaceTopLeft, _remoteSurfaceProxy.SurfaceTopRight, _localSurface.SurfaceTopRight, _localSurface.SurfaceTopLeft); NegativeSpaceCenter = new GameObject("NegativeSpaceCenter"); NegativeSpaceCenter.transform.position = (_localSurface.SurfaceBottomLeft + _remoteSurfaceProxy.SurfaceTopRight) * 0.5f; NegativeSpaceCenter.transform.rotation = GameObject.Find("localScreenCenter").transform.rotation; bottomCenterPosition = (_localSurface.SurfaceBottomLeft + _remoteSurfaceProxy.SurfaceBottomRight) * 0.5f; _handCursor = new GameObject("HandCursor"); _handCursor.transform.position = Vector3.zero; _handCursor.transform.rotation = Quaternion.identity; _handCursor.transform.parent = _main.LocalOrigin.transform; _handCursor.AddComponent <HandCursor>(); GameObject projector = GameObject.Find("Projector"); projector.transform.parent = _handCursor.transform; projector.transform.localPosition = Vector3.zero; projector.transform.rotation = _handCursor.transform.rotation; _spaceCreated = true; }