Exemplo n.º 1
0
        public AnomalyValue(SCANanomaly anomaly, CelestialBody body, SharedObjects sharedObj)
        {
            m_anomaly   = anomaly;
            m_sharedObj = sharedObj;
            m_body      = body;

            RegisterInitializer(InitializeSuffixes);
        }
Exemplo n.º 2
0
        //Display info on the nearest anomaly *Need to separate the BTDT display*
        private void anomalyInfo(int id)
        {
            if ((sensors & SCANtype.AnomalyDetail) != SCANtype.Nothing)
            {
                SCANanomaly nearest      = null;
                double      nearest_dist = -1;
                foreach (SCANanomaly a in data.Anomalies)
                {
                    if (!a.Known)
                    {
                        continue;
                    }
                    double d = (a.Mod.transform.position - v.transform.position).magnitude;
                    if (d < nearest_dist || nearest_dist < 0)
                    {
                        if (d < 50000)
                        {
                            nearest      = a;
                            nearest_dist = d;
                        }
                    }
                }
                if (nearest != null)
                {
                    string txt = "Anomaly";
                    if (nearest.Detail)
                    {
                        txt = nearest.Name;
                    }
                    txt += ":  " + SCANuiUtil.distanceString(nearest_dist, 5000);
                    GUILayout.Label(txt, SCANskins.SCAN_insColorLabel);

                    if (anomalyView == null)
                    {
                        anomalyView = new SCANremoteView();
                    }
                    if (anomalyView != null)
                    {
                        if (nearest.Mod != null)
                        {
                            if (anomalyView.lookat != nearest.Mod.gameObject)
                            {
                                anomalyView.setup(320, 240, nearest.Mod.gameObject);
                            }
                            Texture t = anomalyView.getTexture();
                            if (t != null)
                            {
                                GUILayout.Label(anomalyView.getTexture());
                                anomalyView.drawOverlay(GUILayoutUtility.GetLastRect(), SCANskins.SCAN_anomalyOverlay, nearest.Detail);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
 public SCANanomaly[] getAnomalies()
 {
     if (anomalies == null)
     {
         PQSCity[] sites = body.GetComponentsInChildren <PQSCity>(true);
         anomalies = new SCANanomaly[sites.Length];
         for (int i = 0; i < sites.Length; ++i)
         {
             anomalies[i] = new SCANanomaly(sites[i].name, body.GetLongitude(sites[i].transform.position), body.GetLatitude(sites[i].transform.position), sites[i]);
         }
     }
     for (int i = 0; i < anomalies.Length; ++i)
     {
         anomalies[i].known  = isCovered(anomalies[i].longitude, anomalies[i].latitude, SCANtype.Anomaly);
         anomalies[i].detail = isCovered(anomalies[i].longitude, anomalies[i].latitude, SCANtype.AnomalyDetail);
     }
     return(anomalies);
 }
Exemplo n.º 4
0
 public SCANanomaly[] getAnomalies()
 {
     if (anomalies == null) {
         PQSCity[] sites = body.GetComponentsInChildren<PQSCity> (true);
         anomalies = new SCANanomaly[sites.Length];
         for (int i=0; i<sites.Length; ++i) {
             anomalies [i] = new SCANanomaly (sites [i].name , body.GetLongitude (sites [i].transform.position) , body.GetLatitude (sites [i].transform.position) , sites [i]);
         }
     }
     for (int i=0; i<anomalies.Length; ++i) {
         anomalies [i].known = isCovered (anomalies [i].longitude , anomalies [i].latitude , SCANtype.Anomaly);
         anomalies [i].detail = isCovered (anomalies [i].longitude , anomalies [i].latitude , SCANtype.AnomalyDetail);
     }
     return anomalies;
 }