public void MinimizeAllButOne(GameObject dontClose) { foreach (GameObject Block in displayedBlocks) { //close the rest if (Block != dontClose) { GlobeTouchPoint point = Block.GetComponent <Data_Globe>().thePointScript; point.Minimize(); } } }
private void addThePoint() { //create new point thePoint = NGUITools.AddChild(theFeed.pointOrigin, theFeed.pointPrefab); //rotate the point thePoint.transform.localRotation = Quaternion.Euler(latitude, longatude, 0); //thePoint.transform.Rotate(latitude, longatude, 0); //add refernece to this thePointScript = thePoint.GetComponentInChildren <GlobeTouchPoint>(); thePointScript.dataLink = this; thePointScript.Create(); }
private void AutoFocusClosestProject() { //if count changes, reset closest if (currentCount == displayedBlocks.Count) { if (displayedBlocks.Count > 0 && autoFucus) { //set intial closest to first float minZ = displayedBlocks[0].GetComponent <Data_Globe>().thePointScript.transform.position.z; int indexOfClosest = 0; //find the closest for (int i = 1; i < displayedBlocks.Count; i++) { GlobeTouchPoint point = displayedBlocks[i].GetComponent <Data_Globe>().thePointScript; float currentZ = point.transform.position.z; if (currentZ < minZ) { minZ = currentZ; indexOfClosest = i; } } MinimizeAllButOne(displayedBlocks[indexOfClosest]); if (currentClosestIndex != indexOfClosest) { //update current and open it currentClosestIndex = indexOfClosest; displayedBlocks[currentClosestIndex].GetComponent <Data_Globe>().thePointScript.Maximize(); } } } else { currentClosestIndex = 0; currentCount = displayedBlocks.Count; } }