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);
         }
     }
 }