public void activate(Vector3 pos, Vector3 dir) { float dist = 0.0f; if (accordianType == AccordianActionType.SUBNETS) { if (!submap1 || !submap2 || !submap3) { submap1 = subnet1.GetComponent <SubnetMapping>(); submap2 = subnet2.GetComponent <SubnetMapping>(); submap3 = subnet3.GetComponent <SubnetMapping>(); } dist = submap1.currLayerDist; } else if (accordianType == AccordianActionType.TIMELINE) { if (!timelineScript) { timelineScript = timeline.GetComponent <TimelineScript>(); } dist = timelineScript.getCurrentOffset(); } gameObject.SetActive(true); gameObject.transform.forward = dir; gameObject.transform.position = pos + dir * dist * 2.0f; updateSubLayerReps(dist); }
// Use this for initialization void Start() { submap1 = subnet1.GetComponent <SubnetMapping>(); submap2 = subnet2.GetComponent <SubnetMapping>(); submap3 = subnet3.GetComponent <SubnetMapping>(); timelineScript = timeline.GetComponent <TimelineScript>(); }
// Use this for initialization void Start() { vrSystem = OpenVR.System; otherControllerScript = otherController.GetComponent <ViveController>(); actionAreaManager = actionAreaObject.GetComponent <ActionAreaManager>(); sliderMask = 1 << LayerMask.NameToLayer("slider"); nodesMask = 1 << LayerMask.NameToLayer("nodes"); moveScaleMask = 1 << LayerMask.NameToLayer("moveScale"); playAreaMask = 1 << LayerMask.NameToLayer("playArea"); lineRend = projLineObj.GetComponent <LineRenderer>(); linePts[0] = Vector3.zero; sqlConnClass = sqlConnObject.GetComponent <TestSQLiteConn>(); currSliderScript = timelineObject.GetComponent <TimelineScript>(); accordianManager = accordianObj.GetComponent <AccordianManager>(); }
// Use this for initialization void Start() { timelineScript = timeline.GetComponent <TimelineScript>(); iterTimeOffset = maxIterTime * 1000.0; for (int i = 0; i < 3; i++) { subnetMaps[i] = new Dictionary <long, ipInfo>(); minSubnetIpNum[i] = getIpNumFromString("172." + (i + 1) + "0.0.0"); maxSubnetIpNum[i] = getIpNumFromString("172." + (i + 1) + "0.255.255"); } string conn = this.databaseURI; if (checkBasePathForDB) { string testPath = Directory.GetParent(Application.dataPath).FullName + "\\vast.db"; if (File.Exists(testPath)) { conn = "URI=file:" + testPath; } } Debug.Log("Connecting to: " + conn); dbconn = new SqliteConnection(conn); dbconn.Open(); //Open connection to the database. numSecondsPerSlice = numMinutesPerSlice * 60; setupAllSubnets(); for (int i = 0; i < subnetObjects.Length; i++) { subnetMappings[i] = subnetObjects[i].GetComponent <SubnetMapping>(); if (subnetMappings[i] != null) { subnetMappings[i].mapAllIps(subnetMaps[i]); } } setupTimeSlices(); setupTimeSlicesForBB(); setupTimeSlicesForIPS(); for (int i = 0; i < 3; i++) { currNfIpsSeen[i] = new Dictionary <long, ipDataStruct>(); currBbIpsSeen[i] = new Dictionary <long, bbDataStruct>(); currIPSIpsSeen[i] = new Dictionary <long, ipsDataStruct>(); nextNfIpsSeen[i] = new Dictionary <long, ipDataStruct>(); nextBbIpsSeen[i] = new Dictionary <long, bbDataStruct>(); nextIPSIpsSeen[i] = new Dictionary <long, ipsDataStruct>(); } currTimeIdx = -1; //getVals(); }
void tryHitObjects() { RaycastHit hitInfo; bool stopSearching = false; // try for timeline slider if (Physics.Raycast(deviceRay.origin, deviceRay.direction, out hitInfo, 30.0f, sliderMask)) { projLineObj.SetActive(true); linePts[0] = deviceRay.origin; linePts[1] = deviceRay.GetPoint(hitInfo.distance); lineRend.SetPositions(linePts); onSlider = true; currSliderDist = hitInfo.distance; if (!moveSlider) { SliderManager timelineObj = hitInfo.collider.gameObject.GetComponent <SliderManager>(); if (timelineObj) { currSliderScript = timelineObj.mainTimeline.GetComponent <TimelineScript>(); currSliderScript.hightlightControlLine(); } } stopSearching = true; currMoveQuad = null; currScaleQuad = null; } else if (!moveSlider) { onSlider = false; currSliderScript.deactivateControlLine(); } if (stopSearching) { return; } NodeStatus ns; // try for play area if (Physics.Raycast(deviceRay.origin, deviceRay.direction, out hitInfo, 30.0f, playAreaMask)) { projLineObj.SetActive(true); linePts[0] = deviceRay.origin; linePts[1] = deviceRay.GetPoint(hitInfo.distance); lineRend.SetPositions(linePts); GameObject obj = hitInfo.collider.gameObject; if (obj.name.Equals("listLabel")) { ns = obj.transform.parent.gameObject.GetComponent <ListLabelManager>().nodeStatus; if (ns != null) { } } else if (obj.name.Equals("closeQuad")) { } stopSearching = true; currMoveQuad = null; currScaleQuad = null; } if (stopSearching) { return; } // try for node info if (Physics.Raycast(deviceRay.origin, deviceRay.direction, out hitInfo, 30.0f, nodesMask)) { GameObject hitObj = hitInfo.collider.gameObject; projLineObj.SetActive(true); linePts[0] = deviceRay.origin; linePts[1] = deviceRay.GetPoint(hitInfo.distance); lineRend.SetPositions(linePts); if (currNodeObject != hitObj) { if (currNodeObject == null) { showNodeInfo(); } else { ns = currNodeObject.GetComponent <NodeStatus>(); ns.unhighlightNode(); } currNodeObject = hitObj; ns = hitObj.GetComponent <NodeStatus>(); ns.highlightNode(); updateNodeInfo(ns); } stopSearching = true; currMoveQuad = null; currScaleQuad = null; } else if (currNodeObject != null) { ns = currNodeObject.GetComponent <NodeStatus>(); ns.unhighlightNode(); currNodeObject = null; hideNodeInfo(); } if (stopSearching) { return; } // try for move or scale functions if (Physics.Raycast(deviceRay.origin, deviceRay.direction, out hitInfo, 30.0f, moveScaleMask)) { GameObject hitObj = hitInfo.collider.gameObject; if (hitObj.name.Equals("moveQuad")) { currMoveQuad = hitObj; currScaleQuad = null; } else if (hitObj.name.Equals("scaleQuad")) { currMoveQuad = null; currScaleQuad = hitObj; } projLineObj.SetActive(true); linePts[0] = deviceRay.origin; linePts[1] = deviceRay.GetPoint(hitInfo.distance); lineRend.SetPositions(linePts); currSliderDist = hitInfo.distance; stopSearching = true; } else if (activeScale || activeMove) { projLineObj.SetActive(true); linePts[0] = deviceRay.origin; linePts[1] = deviceRay.GetPoint(currSliderDist); lineRend.SetPositions(linePts); } if (stopSearching) { return; } if (lineAlwaysActive) { linePts[0] = deviceRay.origin; linePts[1] = deviceRay.GetPoint(4); lineRend.SetPositions(linePts); lineRend.startColor = this.rayLineColorStart; lineRend.endColor = this.rayLineColorEnd; } }
void Awake() { Instance = this; }