// Token: 0x0600016D RID: 365 RVA: 0x0000D6E4 File Offset: 0x0000B8E4
        private static void DeserializeVariables(IVariableSource variableSource, Dictionary <string, object> dict, List <UnityEngine.Object> unityObjects)
        {
            object obj;

            if (dict.TryGetValue("Variables", out obj))
            {
                List <SharedVariable> list = new List <SharedVariable>();
                IList list2 = obj as IList;
                for (int i = 0; i < list2.Count; i++)
                {
                    SharedVariable item = JSONDeserializationDeprecated.DeserializeSharedVariable(list2[i] as Dictionary <string, object>, variableSource, true, unityObjects);
                    list.Add(item);
                }
                variableSource.SetAllVariables(list);
            }
        }
        // Token: 0x06000172 RID: 370 RVA: 0x0000E170 File Offset: 0x0000C370
        private static object ValueToObject(Task task, Type type, object obj, IVariableSource variableSource, List <UnityEngine.Object> unityObjects)
        {
            if (type.Equals(typeof(SharedVariable)) || type.IsSubclassOf(typeof(SharedVariable)))
            {
                SharedVariable sharedVariable = JSONDeserializationDeprecated.DeserializeSharedVariable(obj as Dictionary <string, object>, variableSource, false, unityObjects);
                if (sharedVariable == null)
                {
                    sharedVariable = (TaskUtility.CreateInstance(type) as SharedVariable);
                }
                return(sharedVariable);
            }
            if (type.Equals(typeof(UnityEngine.Object)) || type.IsSubclassOf(typeof(UnityEngine.Object)))
            {
                return(JSONDeserializationDeprecated.IndexToUnityObject(Convert.ToInt32(obj), unityObjects));
            }
            if (!type.IsPrimitive)
            {
                if (!type.Equals(typeof(string)))
                {
                    goto IL_C5;
                }
            }
            try
            {
                return(Convert.ChangeType(obj, type));
            }
            catch (Exception)
            {
                return(null);
            }
IL_C5:
            if (type.IsSubclassOf(typeof(Enum)))
            {
                try
                {
                    return(Enum.Parse(type, (string)obj));
                }
                catch (Exception)
                {
                    return(null);
                }
            }
            if (type.Equals(typeof(Vector2)))
            {
                return(JSONDeserializationDeprecated.StringToVector2((string)obj));
            }
            if (type.Equals(typeof(Vector3)))
            {
                return(JSONDeserializationDeprecated.StringToVector3((string)obj));
            }
            if (type.Equals(typeof(Vector4)))
            {
                return(JSONDeserializationDeprecated.StringToVector4((string)obj));
            }
            if (type.Equals(typeof(Quaternion)))
            {
                return(JSONDeserializationDeprecated.StringToQuaternion((string)obj));
            }
            if (type.Equals(typeof(Matrix4x4)))
            {
                return(JSONDeserializationDeprecated.StringToMatrix4x4((string)obj));
            }
            if (type.Equals(typeof(Color)))
            {
                return(JSONDeserializationDeprecated.StringToColor((string)obj));
            }
            if (type.Equals(typeof(Rect)))
            {
                return(JSONDeserializationDeprecated.StringToRect((string)obj));
            }
            if (type.Equals(typeof(LayerMask)))
            {
                return(JSONDeserializationDeprecated.ValueToLayerMask(Convert.ToInt32(obj)));
            }
            if (type.Equals(typeof(AnimationCurve)))
            {
                return(JSONDeserializationDeprecated.ValueToAnimationCurve((Dictionary <string, object>)obj));
            }
            object obj2 = TaskUtility.CreateInstance(type);

            JSONDeserializationDeprecated.DeserializeObject(task, obj2, obj as Dictionary <string, object>, variableSource, unityObjects);
            return(obj2);
        }