예제 #1
0
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                string      customKey;
                List <bool> 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.TryGetBoolList(CustomField.Value, out val);
                }
                else
                {
                    // New item case
                    customKey = GDEDataManager.GetString(ItemName.Value, FieldName.Value, string.Empty);

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

                // Override from saved data if it exists
                val = GDEDataManager.GetBoolList(customKey, CustomField.Value, val);
                StoreResult.SetArrayContents(val);
            }
            catch (UnityException ex)
            {
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                string    customKey;
                Texture2D 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.TryGetTexture2D(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.TryGetTexture2D(CustomField.Value, out val);
                        StoreResult.Value = val;
                    }
                }

                StoreResult.Value = GDEDataManager.GetUnityObject(customKey, CustomField.Value, StoreResult.Value as Texture2D);
            }
            catch (UnityException ex)
            {
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }
예제 #3
0
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                if (GDEDataManager.Get(ItemName.Value, out data))
                {
                    AudioClip val;
                    data.TryGetAudioClip(FieldName.Value, out val);
                    StoreResult.Value = val;
                }

                StoreResult.Value = GDEDataManager.GetUnityObject(ItemName.Value, FieldName.Value, StoreResult.Value as AudioClip);
            }
            catch (UnityException ex)
            {
                Debug.LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }
예제 #4
0
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                if (GDEDataManager.Get(ItemName.Value, out data))
                {
                    float val;
                    data.TryGetFloat(FieldName.Value, out val);
                    StoreResult.Value = val;
                }

                StoreResult.Value = GDEDataManager.GetFloat(FieldKey, StoreResult.Value);
            }
            catch (UnityException ex)
            {
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                if (GDEDataManager.Get(ItemName.Value, out data))
                {
                    string customKey;
                    data.TryGetString(FieldName.Value, out customKey);
                    customKey = GDEDataManager.GetString(ItemName.Value + "_" + FieldName.Value, customKey);

                    GDEDataManager.ResetToDefault(customKey, CustomField.Value);
                }
            }
            catch (UnityException ex)
            {
                LogError(string.Format(GDMConstants.ErrorResettingCustomValue, ItemName.Value, FieldName.Value, CustomField.Value));
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }
예제 #6
0
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                if (GDEDataManager.Get(ItemName.Value, out data))
                {
                    string val;
                    data.TryGetString(FieldName.Value, out val);
                    StoreResult.Value = val;
                }

                // Override with saved data value if it exists
                StoreResult.Value = GDEDataManager.GetString(ItemName.Value, FieldName.Value, StoreResult.Value);
            }
            catch (UnityException ex)
            {
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }
예제 #7
0
        public override void OnEnter()
        {
            try
            {
                Dictionary <string, object> data;
                List <float> val = null;
                if (GDEDataManager.Get(ItemName.Value, out data))
                {
                    data.TryGetFloatList(FieldName.Value, out val);
                }

                // Override from saved data if it exists
                val = GDEDataManager.GetFloatList(ItemName.Value, FieldName.Value, val);
                StoreResult.SetArrayContents(val);
            }
            catch (UnityException ex)
            {
                LogError(ex.ToString());
            }
            finally
            {
                Finish();
            }
        }
예제 #8
0
        public override void OnEnter()
        {
            List <string> allItems      = new List <string>();
            string        currentSchema = "";

            foreach (KeyValuePair <string, object> pair in GDEDataManager.DataDictionary)
            {
                if (pair.Key.StartsWith(GDMConstants.SchemaPrefix))
                {
                    continue;
                }

                //skip if schema not specified
                if (!string.IsNullOrEmpty(searchInSchema.Value))
                {
                    //get all values of current Item
                    Dictionary <string, object> currentDataSet = pair.Value as Dictionary <string, object>;
                    //get Schema of current Item
                    currentDataSet.TryGetString(GDMConstants.SchemaKey, out currentSchema);
                    //check if current Schema equals specified one
                    if (currentSchema != searchInSchema.Value)
                    {
                        continue;
                    }
                }
                //add current Item to List
                allItems.Add(pair.Key);
            }

            hasItem.Value = allItems.Contains(itemName.Value);

            if (!string.IsNullOrEmpty(fieldName.Value))
            {
                try
                {
                    Dictionary <string, object> data;
                    if (GDEDataManager.Get(itemName.Value, out data))
                    {
                        string val;
                        data.TryGetString(fieldName.Value, out val);
                        result = val;
                    }

                    result = GDEDataManager.GetString(itemName.Value, fieldName.Value, result);

                    if (!string.IsNullOrEmpty(result))
                    {
                        hasResult.Value   = true;
                        storeResult.Value = result;
                    }
                    else
                    {
                        hasResult.Value = false;
                    }
                } catch (UnityException ex)
                {
                    UnityEngine.Debug.LogException(ex);
                }
            }

            Finish();
        }