示例#1
0
 public IEnumerator CheckProgress(WWW www, string[] str, double[] target)
 {
     downloadComplete = true;
     while (!www.isDone)
     {
         double dis = calDis.distance(target[1], target[0], double.Parse(str[1]), double.Parse(str[0]));
         if (dis > limits())
         {
             downloadComplete = false;
             www.Dispose();
             yield break;
         }
         else
         {
             yield return(new WaitForSeconds(0f));
             //Debug.Log (Mathf.Round (www.progress) * 100 + "%");
         }
     }
 }
示例#2
0
文件: Zoom.cs 项目: red-pencil/ISWC18
    void Test7()
    {
        Manager mg = GameObject.Find("Manager").GetComponent <Manager> ();

        if (mg.sy_CurrentStatus.is3DCam)
        {
            CalDistance calDis = new CalDistance();

            for (int k = 0; k < mg.sy_Building.coordinate.Count; k++)
            {
                string[] str = mg.sy_Building.coordinate [k].Split(',');
                double   dis = calDis.distance(mg.sy_Coordinate.center [1], mg.sy_Coordinate.center [0], double.Parse(str [1]), double.Parse(str [0]));
                if (limits() != 0 && Mathf.Abs((float)dis) < limits())
                {
                    mg.ImportModeling(mg.sy_Building.name [k], mg.sy_Coordinate.center);
                }
                else
                {
                    if (GameObject.Find("Building Assets") != null)
                    {
                        GameObject test = GameObject.Find("Building Assets");

                        for (int j = 0; j < test.transform.childCount; j++)
                        {
                            if (test.transform.GetChild(j).GetComponent <BuildingData> ().fileName == mg.sy_Building.name [k])
                            {
                                mg.sy_Building.activated_building_name.Remove(test.transform.GetChild(j).GetComponent <BuildingData> ().fileName);
                                test.transform.GetChild(j).GetComponent <BuildingData> ().bundle.Unload(true);
                                GameObject.DestroyImmediate(test.transform.GetChild(j).gameObject);
                                break;
                            }
                        }
                    }
                }
            }
        }
    }
示例#3
0
    public double GetDistanceP1toP2(double P1_longitude_x, double P1_latitude_y, double P2_longitude_x, double P2_latitude_y)
    {
        CalDistance calDis = new CalDistance();

        return(calDis.distance(P1_latitude_y, P1_longitude_x, P2_latitude_y, P2_longitude_x));
    }