コード例 #1
0
    public StringStringDictionary getFields()
    {
        StringStringDictionary fields = StringStringDictionary.New <StringStringDictionary>();

        fields.dictionary.Add("x", gameObject.transform.position.x + "");
        fields.dictionary.Add("y", gameObject.transform.position.y + "");
        fields.dictionary.Add("xv", initialForces.x + "");
        fields.dictionary.Add("yv", initialForces.y + "");
        fields.dictionary.Add("mass", rigidbody.mass + "");
        fields.dictionary.Add("col", "#" + ColorUtility.ToHtmlStringRGB(col));
        return(fields);
    }
コード例 #2
0
    IEnumerator DoActionGetInfo()
    {
        GoogleSheetReader _googleSheetReader = new GoogleSheetReader(googleSheetAppID, spreadSheetID);

        Debug.Log("Load Key Localize From Google!!!");
        yield return(_googleSheetReader.Load(fromCell, toCell, sheetID));

        var _value = _googleSheetReader.GetValues();

        Debug.Log("Start Load Key: " + _googleSheetReader.rawResult);
        listDetail = new List <string>();
        for (int i = 0; i < _value.Count; i++)
        {
            for (int j = 0; j < _value[i].Count; j++)
            {
                string _tmp = _value[i][j].Value;
                if (string.IsNullOrEmpty(_tmp))
                {
                    Debug.LogError("Bug : i = " + i + " + j = " + j);
                    yield break;
                }
                if (_tmp.Equals("NULL"))
                {
                    listDetail.Add(string.Empty);
                    continue;
                }
                // _tmp = _tmp.ToLower();
                _tmp = _tmp.TrimStart();
                _tmp = _tmp.TrimEnd();
                // _tmp = _tmp.Replace("%", string.Empty);
                listDetail.Add(_tmp);
            }
        }

        if (listDetail == null || listDetail.Count == 0)
        {
            Debug.Log("listDetail is null!!!");
            yield break;
        }

        myListLocalizeInfo.localize_En.store = StringStringDictionary.New <StringStringDictionary>();

        for (int i = 0; i < listDetail.Count; i++)
        {
            string[] _fields = listDetail[i].Split('#');
            if (_fields == null || _fields.Length == 0)
            {
                continue;
            }
            string _nameSheet = _fields[0];
            for (int j = 1; j < _fields.Length; j++)
            {
                if (string.IsNullOrEmpty(_fields[j]))
                {
                    Debug.LogWarning("Skip At Index : " + i + " with detail : " + j);
                    break;
                }
                string[] _fields_01 = _fields[j].Split(';');
                if (_fields_01 == null || _fields_01.Length == 0)
                {
                    continue;
                }
                string _key     = _fields_01[0];
                string _valueEN = _fields_01[1];
                myListLocalizeInfo.localize_En.store.dictionary.Add(_nameSheet + "/" + _key, _valueEN);
            }
        }

        UnityEditor.EditorUtility.SetDirty(myListLocalizeInfo.localize_En);

        Debug.Log("Completed!!!");
    }
コード例 #3
0
 public ScriptableObjectDatabase()
 {
     m_DbDictionary = StringStringDictionary.New <StringStringDictionary>();
 }