public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                string customKey;
                Color  val;

                if (GDEDataManager.DataDictionary.ContainsKey(ItemName.Value))
                {
                    GDEDataManager.Get(ItemName.Value, out data);
                    data.TryGetString(FieldName.Value, out customKey);
                    customKey = GDEDataManager.GetString(ItemName.Value, FieldName.Value, customKey);

                    Dictionary <string, object> customData;
                    GDEDataManager.Get(customKey, out customData);

                    customData.TryGetColor(CustomField.Value, out val);
                    StoreResult.Value = val;
                }
                else
                {
                    // New item case
                    customKey = GDEDataManager.GetString(ItemName.Value, FieldName.Value, string.Empty);

                    if (GDEDataManager.Get(customKey, out data))
                    {
                        data.TryGetColor(CustomField.Value, out val);
                        StoreResult.Value = val;
                    }
                }

                StoreResult.Value = GDEDataManager.GetColor(customKey, CustomField.Value, StoreResult.Value);
            }
            catch (UnityException ex)
            {
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }
Esempio n. 2
0
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                if (GDEDataManager.Get(ItemName.Value, out data))
                {
                    Color val;
                    data.TryGetColor(FieldName.Value, out val);
                    StoreResult.Value = val;
                }

                StoreResult.Value = GDEDataManager.GetColor(ItemName.Value, FieldName.Value, StoreResult.Value);
            }
            catch (UnityException ex)
            {
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }