예제 #1
0
 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();
         }
     }
 }
예제 #2
0
    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();
    }
예제 #3
0
    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;
        }
    }