Beispiel #1
0
 void Update()
 {
     if (frame % 10 == 0)
     {
         frame = 0;
         EntityQuery pathQuery  = entityManager.CreateEntityQuery(ComponentType.ReadOnly <SatPath>());
         Entity      pathEntity = pathQuery.GetSingletonEntity();
         SatPath     satPath    = entityManager.GetComponentData <SatPath>(pathEntity);
         UpdateGUIText(satPath);
     }
 }
Beispiel #2
0
    private void UpdateGUIText(SatPath path)
    {
        if (ctr.startEntity != Entity.Null)
        {
            if (path.Hops == 0)
            {
                textSPDist.color = Color.red;
                textSPDist.text  = "Error: No satellite coverage.";
                textSPRTT.text   = "";
            }
            else
            {
                correctedLength = path.Length * ctr.earthRadius;
                float satRTT = ((2 * correctedLength * 1000) / ctr.Cv) * 1000;

                textSPDist.color = Color.white;
                textSPDist.text  = "Sat link has " + path.Hops + " hops over " + correctedLength.ToString("F0") + " km";
                textSPRTT.text   = "Sat link RTT: " + satRTT.ToString("F0") + "ms";
            }
        }
    }