Beispiel #1
0
 void LookAt()
 {
     if (obj == null)
     {
         return;
     }
     if (obj.gameObject.activeSelf)
     {
         GameObject     camObj     = GameObject.Find("Main Camera") as GameObject;
         CameraMovement cameraCont = camObj.GetComponent <CameraMovement> ();
         if (type == 1)
         {
             pointCloud cloudObj = obj.GetComponent <pointCloud> ();
             cameraCont.CloseWatch(cloudObj.GetCenterPos());
         }
         if (type == 2)
         {
             KFListObj kfObj = obj.GetComponent <KFListObj> ();
             cameraCont.CloseWatch(kfObj.GetCenterPos());
         }
         if (type == 3)
         {
             RoadMesh raodobj = obj.GetComponent <RoadMesh> ();
             cameraCont.CloseWatch(raodobj.lookAtPoint);
         }
     }
 }
Beispiel #2
0
    public static Transform create(List <mapPoint> pointlist)
    {
        if (mShader == null)
        {
            mShader = Resources.Load("pointShader") as Shader;
        }
        if (rootObj == null)
        {
            rootObj      = new GameObject().transform;
            rootObj.name = "CloudRoot";
        }
        GameObject obj = new GameObject();

        obj.transform.SetParent(rootObj);
        obj.name = "pointCloud";
        pointCloud self = obj.AddComponent <pointCloud>();

        self.pointlist = pointlist;
        return(obj.transform);
    }