Esempio n. 1
0
 public int CompareByNames(XMLBuilding city1, XMLBuilding city2)
 {
     if (m_sortDirection.flip == UISpriteFlip.None)
     {
         return(String.Compare(city1.name, city2.name));
     }
     else
     {
         return(String.Compare(city1.name, city2.name));
     }
 }
Esempio n. 2
0
        public override void Display(object obj, bool isRowOdd)
        {
            m_meshData = obj as XMLBuilding;

            if (m_meshData == null || m_name == null)
            {
                return;
            }

            m_name.text      = m_meshData.name;
            statusLabel.text = m_meshData.status;
            m_triangles.text = m_meshData.district;
            float num = m_meshData.upkeep * 0.0016f;

            m_textureSize.text = num.ToString(num < 10f ? Settings.moneyFormatNoCents : Settings.moneyFormat, LocaleManager.cultureInfo);

            /*
             * m_weight.text = (m_meshData.weight > 0) ? m_meshData.weight.ToString("N2") : "-";
             * if (m_meshData.weight >= 200)
             *  m_weight.textColor = new Color32(255, 0, 0, 255);
             * else if (m_meshData.weight >= 100)
             *  m_weight.textColor = new Color32(255, 255, 0, 255);
             * else if (m_meshData.weight > 0)
             *  m_weight.textColor = new Color32(0, 255, 0, 255);
             * else
             *  m_weight.textColor = new Color32(255, 255, 255, 255);
             *
             * m_lodWeight.text = (m_meshData.lodWeight > 0) ? m_meshData.lodWeight.ToString("N2") : "-";
             * if (m_meshData.lodWeight >= 10)
             *  m_lodWeight.textColor = new Color32(255, 0, 0, 255);
             * else if (m_meshData.lodWeight >= 5)
             *  m_lodWeight.textColor = new Color32(255, 255, 0, 255);
             * else if (m_meshData.lodWeight > 0)
             *  m_lodWeight.textColor = new Color32(0, 255, 0, 255);
             * else
             *  m_lodWeight.textColor = new Color32(255, 255, 255, 255);
             *
             * m_textureSize.text = (m_meshData.textureSize != Vector2.zero) ? m_meshData.textureSize.x + "x" + m_meshData.textureSize.y : "-";
             * m_lodTextureSize.text = (m_meshData.lodTextureSize != Vector2.zero) ? m_meshData.lodTextureSize.x + "x" + m_meshData.lodTextureSize.y : "-";
             */
            baseBgOpacity = isRowOdd ? 0.25f : 0.1f;
            Background.backgroundSprite = "1";
            Background.opacity          = baseBgOpacity;
        }