コード例 #1
0
ファイル: dfLanguageManager.cs プロジェクト: dadebert/Semi
        public void LoadLanguage(dfLanguageCode language, bool forceReload = false)
        {
            if (I18N.CurrentUIDict == null)
            {
                orig_LoadLanguage(language, forceReload);
            }
            else
            {
                strings = I18N.CurrentUIDict;

                if (forceReload)
                {
                    dfControl[] componentsInChildren = base.GetComponentsInChildren <dfControl>();
                    for (int i = 0; i < componentsInChildren.Length; i++)
                    {
                        componentsInChildren[i].Localize();
                    }
                    for (int j = 0; j < componentsInChildren.Length; j++)
                    {
                        componentsInChildren[j].PerformLayout();
                        if (componentsInChildren[j].LanguageChanged != null)
                        {
                            componentsInChildren[j].LanguageChanged(componentsInChildren[j]);
                        }
                    }
                }
            }
        }
コード例 #2
0
ファイル: GameInfo.cs プロジェクト: k-payl/Runner
        public void Load()
        {
            if (File.Exists(Application.persistentDataPath + "/playerInfo.dat"))
            {
                BinaryFormatter bf   = new BinaryFormatter();
                FileStream      file = File.Open(Application.persistentDataPath + "/playerInfo.dat", FileMode.Open);
                try
                {
                    GameInfo i = (GameInfo)bf.Deserialize(file);
                    Debug.Log("Loaded \'" + Application.persistentDataPath + "/playerInfo.dat\'");


                    i.bonuses.Load();
                    bonuses = i.bonuses;

                    GameManager.Instance.CollectionInitializedEvent(bonuses);

                    completedLevels = i.completedLevels;
                    lang            = i.lang;
                }
                catch (Exception)
                {
                    Debug.Log("Created new info. (Catched exception in Deserialize())");
                    Reset();
                }

                file.Close();
            }
            else
            {
                Debug.Log("File \'" + Application.persistentDataPath + "/playerInfo.dat\' isn't exist");
                Reset();
            }
        }
コード例 #3
0
ファイル: GameInfo.cs プロジェクト: k-payl/Runner
 public void Reset()
 {
     bonuses         = new BonusCollection();
     completedLevels = 0;
     lang            = dfLanguageCode.EN;
     Debug.Log("info reseted");
     GameManager.Instance.CollectionInitializedEvent(bonuses);
 }
コード例 #4
0
    public void Start()
    {
        dfLanguageCode languageCode = this.currentLanguage;

        if (this.currentLanguage == dfLanguageCode.None)
        {
            languageCode = this.SystemLanguageToLanguageCode(Application.systemLanguage);
        }
        this.LoadLanguage(languageCode);
    }
コード例 #5
0
 public void LoadLanguage(dfLanguageCode language)
 {
     this.currentLanguage = language;
     this.strings.Clear();
     if (this.dataFile != null)
     {
         this.parseDataFile();
     }
     dfControl[] componentsInChildren = base.GetComponentsInChildren <dfControl>();
     for (int i = 0; i < (int)componentsInChildren.Length; i++)
     {
         componentsInChildren[i].Localize();
     }
 }
コード例 #6
0
 public void LoadLanguage(dfLanguageCode language)
 {
     this.currentLanguage = language;
     this.strings.Clear();
     if (this.dataFile != null)
     {
         this.parseDataFile();
     }
     dfControl[] componentsInChildren = base.GetComponentsInChildren<dfControl>();
     for (int i = 0; i < (int)componentsInChildren.Length; i++)
     {
         componentsInChildren[i].Localize();
     }
 }
コード例 #7
0
    /// <summary>
    /// Loads the indicated language from the data file
    /// </summary>
    /// <param name="language">The language code representing the language data to be loaded</param>
    public void LoadLanguage(dfLanguageCode language)
    {
        // Keep track of the current language
        this.currentLanguage = language;

        // Start from a clean slate
        strings.Clear();

        if (dataFile != null)
        {
            parseDataFile();
        }

        // When the language is loaded, localize all controls
        var controls = GetComponentsInChildren <dfControl>();

        for (int i = 0; i < controls.Length; i++)
        {
            controls[i].Localize();
        }
    }
コード例 #8
0
ファイル: dfLanguageManager.cs プロジェクト: dadebert/Semi
 public extern void orig_LoadLanguage(dfLanguageCode language, bool forceReload = false);
コード例 #9
0
ファイル: GameInfo.cs プロジェクト: k-payl/Runner
 public GameInfo()
 {
     bonuses         = new BonusCollection();
     completedLevels = 0;
     lang            = dfLanguageCode.EN;
 }
コード例 #10
0
	/// <summary>
	/// Loads the indicated language from the data file
	/// </summary>
	/// <param name="language">The language code representing the language data to be loaded</param>
	public void LoadLanguage( dfLanguageCode language )
	{

		// Keep track of the current language
		this.currentLanguage = language;

		// Start from a clean slate
		strings.Clear();

		if( dataFile != null )
		{
			parseDataFile();
		}
		
		// When the language is loaded, localize all controls
		var controls = GetComponentsInChildren<dfControl>();
		for( int i = 0; i < controls.Length; i++ )
		{
			controls[ i ].Localize();
		}

	}