예제 #1
0
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                string       customKey;
                List <Color> val = null;

                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.TryGetColorList(CustomField.Value, out val);
                }
                else
                {
                    // New item case
                    customKey = GDEDataManager.GetString(ItemName.Value, FieldName.Value, string.Empty);

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

                // Override from saved data if it exists
                val = GDEDataManager.GetColorList(customKey, CustomField.Value, val);
                StoreResult.SetArrayContents(val);
            }
            catch (UnityException ex)
            {
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }
예제 #2
0
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                List <Color> val = null;
                if (GDEDataManager.Get(ItemName.Value, out data))
                {
                    data.TryGetColorList(FieldName.Value, out val);
                }

                // Override from saved data if it exists
                val = GDEDataManager.GetColorList(ItemName.Value, FieldName.Value, val);
                StoreResult.SetArrayContents(val);
            }
            catch (UnityException ex)
            {
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }