Exemple #1
0
 public void SetUnicodeChars(string chars)
 {
     if (chars == null || chars.Length < 1)
     {
         chars = m_unicodeChars;
     }
     m_unicodeChars = chars;
     UnityDirectoryStorage.SaveFile("JavaOMI", "UnicodePrefList.txt", m_unicodeChars, m_saveOnHarddrive);
     Refresh();
 }
    private void SavePrefData(bool saveOnharddrive = true)
    {
        PreferenceSave toSave = new PreferenceSave();

        toSave.m_autoStart  = m_autoStart.isOn;
        toSave.m_threadName = GetServerName();
        toSave.m_port       = GetServerPort();
        toSave.m_ip[0]      = m_ip[0].GetIndex();
        toSave.m_ip[1]      = m_ip[1].GetIndex();
        toSave.m_ip[2]      = m_ip[2].GetIndex();
        toSave.m_ip[3]      = m_ip[3].GetIndex();

        UnityDirectoryStorage.SaveFile("JavaOMI", m_prefId + ".txt", JsonUtility.ToJson(toSave), saveOnharddrive);
    }
    private void LoadPrefData(bool saveOnharddrive = true)
    {
        PreferenceSave toLoad = new PreferenceSave();

        string loaded = UnityDirectoryStorage.LoadFile("JavaOMI", m_prefId + ".txt", saveOnharddrive);

        if (loaded == null || loaded == "")
        {
            return;
        }
        toLoad = JsonUtility.FromJson <PreferenceSave>(loaded);
        if (toLoad == null)
        {
            return;
        }

        m_autoStart.isOn = toLoad.m_autoStart;
        m_name.text      = toLoad.m_threadName;
        m_port.text      = "" + toLoad.m_port;
        m_ip[0].SetIndex(toLoad.m_ip[0]);
        m_ip[1].SetIndex(toLoad.m_ip[1]);
        m_ip[2].SetIndex(toLoad.m_ip[2]);
        m_ip[3].SetIndex(toLoad.m_ip[3]);
    }
Exemple #4
0
 private void OnApplicationQuit()
 {
     UnityDirectoryStorage.SaveFile("JavaOMI", "UnicodePrefList.txt", m_unicodeChars, m_saveOnHarddrive);
 }
Exemple #5
0
 private void OnEnable()
 {
     SetUnicodeChars(UnityDirectoryStorage.LoadFile("JavaOMI", "UnicodePrefList.txt", m_saveOnHarddrive));
     Refresh();
 }
Exemple #6
0
 private void Start()
 {
     SetUnicodeChars(UnityDirectoryStorage.LoadFile("JavaOMI", "UnicodePrefList.txt", m_saveOnHarddrive));
     Invoke("Refresh", 0.1f);
     Refresh();
 }