Esempio n. 1
0
 public void Unload()
 {
     if (m_referenceCount == 0)
     {
         Log.Error("Tried to unload font collection named '" + this.get_name() + "' but it is not loaded.", 359, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\FontCollection.cs");
         return;
     }
     m_referenceCount--;
     if (m_referenceCount <= 0)
     {
         RuntimeData.CultureCodeChanged -= CultureCodeChanged;
         m_styleMaterial = null;
         m_fontAsset     = null;
         m_fontData      = null;
     }
 }
Esempio n. 2
0
        public void Load()
        {
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_005a: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
            if (m_referenceCount > 0)
            {
                m_referenceCount++;
                return;
            }
            FontLanguage currentFontLanguage = RuntimeData.currentFontLanguage;

            if (!((Dictionary <FontLanguage, FontData>)m_data).TryGetValue(currentFontLanguage, out FontData value))
            {
                Log.Error($"Font collection named '{this.get_name()}' doesn't have any font data for font language '{currentFontLanguage}'.", 256, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\FontCollection.cs");
                return;
            }
            AssetReference fontAssetReference = value.fontAssetReference;

            if (!fontAssetReference.get_hasValue())
            {
                Log.Error($"Font collection named '{this.get_name()}' doesn't have a font setup for font language '{currentFontLanguage}'.", 263, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\FontCollection.cs");
                return;
            }
            TMP_FontAsset val = fontAssetReference.LoadFromResources <TMP_FontAsset>();

            if (null == val)
            {
                Log.Error($"Font collection named '{this.get_name()}' failed to load font for font language '{currentFontLanguage}'.", 270, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\FontCollection.cs");
                return;
            }
            AssetReference styleMaterialReference = value.styleMaterialReference;
            Material       styleMaterial          = styleMaterialReference.get_hasValue() ? styleMaterialReference.LoadFromResources <Material>() : null;

            RuntimeData.CultureCodeChanged += CultureCodeChanged;
            m_fontData       = value;
            m_fontAsset      = val;
            m_styleMaterial  = styleMaterial;
            m_referenceCount = 1;
        }
Esempio n. 3
0
        private void ChangeFontLanguage(FontLanguage fontLanguage)
        {
            //IL_0037: Unknown result type (might be due to invalid IL or missing references)
            //IL_003c: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
            if (!((Dictionary <FontLanguage, FontData>)m_data).TryGetValue(fontLanguage, out FontData value))
            {
                Log.Error($"Font collection named '{this.get_name()}' doesn't have any font data for font language '{fontLanguage}'.", 444, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\FontCollection.cs");
                return;
            }
            AssetReference fontAssetReference = value.fontAssetReference;

            if (!fontAssetReference.get_hasValue())
            {
                Log.Error($"Font collection named '{this.get_name()}' doesn't have a font setup for font language '{fontLanguage}'.", 451, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\FontCollection.cs");
                return;
            }
            TMP_FontAsset val = fontAssetReference.LoadFromResources <TMP_FontAsset>();

            if (null == val)
            {
                Log.Error($"Font collection named '{this.get_name()}' failed to load font for font language '{fontLanguage}'.", 458, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\FontCollection.cs");
                return;
            }
            AssetReference styleMaterialReference = value.styleMaterialReference;
            Material       styleMaterial          = styleMaterialReference.get_hasValue() ? styleMaterialReference.LoadFromResources <Material>() : null;

            if (null != m_styleMaterial)
            {
                Resources.UnloadAsset(m_styleMaterial);
            }
            if (null != m_fontAsset)
            {
                Resources.UnloadAsset(m_fontAsset);
            }
            m_fontData      = value;
            m_fontAsset     = val;
            m_styleMaterial = styleMaterial;
        }