Пример #1
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.FixedJoint2D fixedJoint2D = (UnityEngine.FixedJoint2D)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "dampingRatio":
                    fixedJoint2D.dampingRatio = reader.ReadProperty <System.Single> ();
                    break;

                case "frequency":
                    fixedJoint2D.frequency = reader.ReadProperty <System.Single> ();
                    break;

                case "anchor":
                    fixedJoint2D.anchor = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "connectedAnchor":
                    fixedJoint2D.connectedAnchor = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "autoConfigureConnectedAnchor":
                    fixedJoint2D.autoConfigureConnectedAnchor = reader.ReadProperty <System.Boolean> ();
                    break;

                case "connectedBody":
                    if (fixedJoint2D.connectedBody == null)
                    {
                        fixedJoint2D.connectedBody = reader.ReadProperty <UnityEngine.Rigidbody2D> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Rigidbody2D> (fixedJoint2D.connectedBody);
                    }
                    break;

                case "enableCollision":
                    fixedJoint2D.enableCollision = reader.ReadProperty <System.Boolean> ();
                    break;

                case "breakForce":
                    fixedJoint2D.breakForce = reader.ReadProperty <System.Single> ();
                    break;

                case "breakTorque":
                    fixedJoint2D.breakTorque = reader.ReadProperty <System.Single> ();
                    break;

                case "enabled":
                    fixedJoint2D.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    fixedJoint2D.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    fixedJoint2D.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    fixedJoint2D.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.HingeJoint hingeJoint = (UnityEngine.HingeJoint)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "motor":
                    hingeJoint.motor = reader.ReadProperty <UnityEngine.JointMotor>();
                    break;

                case "limits":
                    hingeJoint.limits = reader.ReadProperty <UnityEngine.JointLimits>();
                    break;

                case "spring":
                    hingeJoint.spring = reader.ReadProperty <UnityEngine.JointSpring>();
                    break;

                case "useMotor":
                    hingeJoint.useMotor = reader.ReadProperty <System.Boolean>();
                    break;

                case "useLimits":
                    hingeJoint.useLimits = reader.ReadProperty <System.Boolean>();
                    break;

                case "useSpring":
                    hingeJoint.useSpring = reader.ReadProperty <System.Boolean>();
                    break;

                case "connectedBody":
                    if (hingeJoint.connectedBody == null)
                    {
                        hingeJoint.connectedBody = reader.ReadProperty <UnityEngine.Rigidbody>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Rigidbody>(hingeJoint.connectedBody);
                    }
                    break;

                case "axis":
                    hingeJoint.axis = reader.ReadProperty <UnityEngine.Vector3>();
                    break;

                case "anchor":
                    hingeJoint.anchor = reader.ReadProperty <UnityEngine.Vector3>();
                    break;

                case "connectedAnchor":
                    hingeJoint.connectedAnchor = reader.ReadProperty <UnityEngine.Vector3>();
                    break;

                case "autoConfigureConnectedAnchor":
                    hingeJoint.autoConfigureConnectedAnchor = reader.ReadProperty <System.Boolean>();
                    break;

                case "breakForce":
                    hingeJoint.breakForce = reader.ReadProperty <System.Single>();
                    break;

                case "breakTorque":
                    hingeJoint.breakTorque = reader.ReadProperty <System.Single>();
                    break;

                case "enableCollision":
                    hingeJoint.enableCollision = reader.ReadProperty <System.Boolean>();
                    break;

                case "enablePreprocessing":
                    hingeJoint.enablePreprocessing = reader.ReadProperty <System.Boolean>();
                    break;

                case "massScale":
#if UNITY_2017_1_OR_NEWER
                    hingeJoint.massScale = reader.ReadProperty <System.Single>();
#else
                    reader.ReadProperty <System.Single>();
#endif
                    break;

                case "connectedMassScale":
#if UNITY_2017_1_OR_NEWER
                    hingeJoint.connectedMassScale = reader.ReadProperty <System.Single>();
#else
                    reader.ReadProperty <System.Single>();
#endif
                    break;

                case "tag":
                    hingeJoint.tag = reader.ReadProperty <System.String>();
                    break;

                case "name":
                    hingeJoint.name = reader.ReadProperty <System.String>();
                    break;

                case "hideFlags":
                    hingeJoint.hideFlags = reader.ReadProperty <UnityEngine.HideFlags>();
                    break;
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.RelativeJoint2D relativeJoint2D = (UnityEngine.RelativeJoint2D)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "maxForce":
                    relativeJoint2D.maxForce = reader.ReadProperty <System.Single> ();
                    break;

                case "maxTorque":
                    relativeJoint2D.maxTorque = reader.ReadProperty <System.Single> ();
                    break;

                case "correctionScale":
                    relativeJoint2D.correctionScale = reader.ReadProperty <System.Single> ();
                    break;

                case "autoConfigureOffset":
                    relativeJoint2D.autoConfigureOffset = reader.ReadProperty <System.Boolean> ();
                    break;

                case "linearOffset":
                    relativeJoint2D.linearOffset = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "angularOffset":
                    relativeJoint2D.angularOffset = reader.ReadProperty <System.Single> ();
                    break;

                case "connectedBody":
                    if (relativeJoint2D.connectedBody == null)
                    {
                        relativeJoint2D.connectedBody = reader.ReadProperty <UnityEngine.Rigidbody2D> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Rigidbody2D> (relativeJoint2D.connectedBody);
                    }
                    break;

                case "enableCollision":
                    relativeJoint2D.enableCollision = reader.ReadProperty <System.Boolean> ();
                    break;

                case "breakForce":
                    relativeJoint2D.breakForce = reader.ReadProperty <System.Single> ();
                    break;

                case "breakTorque":
                    relativeJoint2D.breakTorque = reader.ReadProperty <System.Single> ();
                    break;

                case "enabled":
                    relativeJoint2D.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    relativeJoint2D.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    relativeJoint2D.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    relativeJoint2D.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.CompositeCollider2D compositeCollider2D = (UnityEngine.CompositeCollider2D)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "geometryType":
                    compositeCollider2D.geometryType = reader.ReadProperty <UnityEngine.CompositeCollider2D.GeometryType> ();
                    break;

                case "generationType":
                    compositeCollider2D.generationType = reader.ReadProperty <UnityEngine.CompositeCollider2D.GenerationType> ();
                    break;

                case "vertexDistance":
                    compositeCollider2D.vertexDistance = reader.ReadProperty <System.Single> ();
                    break;

                case "edgeRadius":
                    compositeCollider2D.edgeRadius = reader.ReadProperty <System.Single> ();
                    break;

                case "density":
                    compositeCollider2D.density = reader.ReadProperty <System.Single> ();
                    break;

                case "isTrigger":
                    compositeCollider2D.isTrigger = reader.ReadProperty <System.Boolean> ();
                    break;

                case "usedByEffector":
                    compositeCollider2D.usedByEffector = reader.ReadProperty <System.Boolean> ();
                    break;

                case "usedByComposite":
                    compositeCollider2D.usedByComposite = reader.ReadProperty <System.Boolean> ();
                    break;

                case "offset":
                    compositeCollider2D.offset = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "sharedMaterial":
                    if (compositeCollider2D.sharedMaterial == null)
                    {
                        compositeCollider2D.sharedMaterial = reader.ReadProperty <UnityEngine.PhysicsMaterial2D> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.PhysicsMaterial2D> (compositeCollider2D.sharedMaterial);
                    }
                    break;

                case "enabled":
                    compositeCollider2D.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    compositeCollider2D.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    compositeCollider2D.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    compositeCollider2D.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Пример #5
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.Projector projector = (UnityEngine.Projector)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "nearClipPlane":
                    projector.nearClipPlane = reader.ReadProperty <System.Single> ();
                    break;

                case "farClipPlane":
                    projector.farClipPlane = reader.ReadProperty <System.Single> ();
                    break;

                case "fieldOfView":
                    projector.fieldOfView = reader.ReadProperty <System.Single> ();
                    break;

                case "aspectRatio":
                    projector.aspectRatio = reader.ReadProperty <System.Single> ();
                    break;

                case "orthographic":
                    projector.orthographic = reader.ReadProperty <System.Boolean> ();
                    break;

                case "orthographicSize":
                    projector.orthographicSize = reader.ReadProperty <System.Single> ();
                    break;

                case "ignoreLayers":
                    projector.ignoreLayers = reader.ReadProperty <System.Int32> ();
                    break;

                case "material":
                    if (projector.material == null)
                    {
                        projector.material = reader.ReadProperty <UnityEngine.Material> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Material> (projector.material);
                    }
                    break;

                case "enabled":
                    projector.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    projector.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    projector.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    projector.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.AudioSource audioSource = (UnityEngine.AudioSource)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "volume":
                    audioSource.volume = reader.ReadProperty <System.Single> ();
                    break;

                case "pitch":
                    audioSource.pitch = reader.ReadProperty <System.Single> ();
                    break;

                case "time":
                    audioSource.time = reader.ReadProperty <System.Single> ();
                    break;

                case "timeSamples":
                    audioSource.timeSamples = reader.ReadProperty <System.Int32> ();
                    break;

                case "clip":
                    if (audioSource.clip == null)
                    {
                        audioSource.clip = reader.ReadProperty <UnityEngine.AudioClip> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.AudioClip> (audioSource.clip);
                    }
                    break;

                case "outputAudioMixerGroup":
                    if (audioSource.outputAudioMixerGroup == null)
                    {
                        audioSource.outputAudioMixerGroup = reader.ReadProperty <UnityEngine.Audio.AudioMixerGroup> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Audio.AudioMixerGroup> (audioSource.outputAudioMixerGroup);
                    }
                    break;

                case "loop":
                    audioSource.loop = reader.ReadProperty <System.Boolean> ();
                    break;

                case "ignoreListenerVolume":
                    audioSource.ignoreListenerVolume = reader.ReadProperty <System.Boolean> ();
                    break;

                case "playOnAwake":
                    audioSource.playOnAwake = reader.ReadProperty <System.Boolean> ();
                    break;

                case "ignoreListenerPause":
                    audioSource.ignoreListenerPause = reader.ReadProperty <System.Boolean> ();
                    break;

                case "velocityUpdateMode":
                    audioSource.velocityUpdateMode = reader.ReadProperty <UnityEngine.AudioVelocityUpdateMode> ();
                    break;

                case "panStereo":
                    audioSource.panStereo = reader.ReadProperty <System.Single> ();
                    break;

                case "spatialBlend":
                    audioSource.spatialBlend = reader.ReadProperty <System.Single> ();
                    break;

                case "spatialize":
                    audioSource.spatialize = reader.ReadProperty <System.Boolean> ();
                    break;

                case "spatializePostEffects":
                    audioSource.spatializePostEffects = reader.ReadProperty <System.Boolean> ();
                    break;

                case "reverbZoneMix":
                    audioSource.reverbZoneMix = reader.ReadProperty <System.Single> ();
                    break;

                case "bypassEffects":
                    audioSource.bypassEffects = reader.ReadProperty <System.Boolean> ();
                    break;

                case "bypassListenerEffects":
                    audioSource.bypassListenerEffects = reader.ReadProperty <System.Boolean> ();
                    break;

                case "bypassReverbZones":
                    audioSource.bypassReverbZones = reader.ReadProperty <System.Boolean> ();
                    break;

                case "dopplerLevel":
                    audioSource.dopplerLevel = reader.ReadProperty <System.Single> ();
                    break;

                case "spread":
                    audioSource.spread = reader.ReadProperty <System.Single> ();
                    break;

                case "priority":
                    audioSource.priority = reader.ReadProperty <System.Int32> ();
                    break;

                case "mute":
                    audioSource.mute = reader.ReadProperty <System.Boolean> ();
                    break;

                case "minDistance":
                    audioSource.minDistance = reader.ReadProperty <System.Single> ();
                    break;

                case "maxDistance":
                    audioSource.maxDistance = reader.ReadProperty <System.Single> ();
                    break;

                case "rolloffMode":
                    audioSource.rolloffMode = reader.ReadProperty <UnityEngine.AudioRolloffMode> ();
                    break;

                case "enabled":
                    audioSource.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    audioSource.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    audioSource.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    audioSource.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Пример #7
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.TrailRenderer trailRenderer = (UnityEngine.TrailRenderer)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "time":
                    trailRenderer.time = reader.ReadProperty <System.Single>();
                    break;

                case "startWidth":
                    trailRenderer.startWidth = reader.ReadProperty <System.Single>();
                    break;

                case "endWidth":
                    trailRenderer.endWidth = reader.ReadProperty <System.Single>();
                    break;

                case "widthCurve":
                    trailRenderer.widthCurve = reader.ReadProperty <UnityEngine.AnimationCurve>();
                    break;

                case "widthMultiplier":
                    trailRenderer.widthMultiplier = reader.ReadProperty <System.Single>();
                    break;

                case "startColor":
                    trailRenderer.startColor = reader.ReadProperty <UnityEngine.Color>();
                    break;

                case "endColor":
                    trailRenderer.endColor = reader.ReadProperty <UnityEngine.Color>();
                    break;

                case "colorGradient":
                    trailRenderer.colorGradient = reader.ReadProperty <UnityEngine.Gradient>();
                    break;

                case "autodestruct":
                    trailRenderer.autodestruct = reader.ReadProperty <System.Boolean>();
                    break;

                case "numCornerVertices":
                    trailRenderer.numCornerVertices = reader.ReadProperty <System.Int32>();
                    break;

                case "numCapVertices":
                    trailRenderer.numCapVertices = reader.ReadProperty <System.Int32>();
                    break;

                case "minVertexDistance":
                    trailRenderer.minVertexDistance = reader.ReadProperty <System.Single>();
                    break;

                case "textureMode":
                    trailRenderer.textureMode = reader.ReadProperty <UnityEngine.LineTextureMode>();
                    break;

                case "alignment":
                    trailRenderer.alignment = reader.ReadProperty <UnityEngine.LineAlignment>();
                    break;

                case "generateLightingData":
#if UNITY_2017_1_OR_NEWER
                    trailRenderer.generateLightingData = reader.ReadProperty <System.Boolean>();
#else
                    reader.ReadProperty <System.Boolean>();
#endif
                    break;

                case "enabled":
                    trailRenderer.enabled = reader.ReadProperty <System.Boolean>();
                    break;

                case "shadowCastingMode":
                    trailRenderer.shadowCastingMode = reader.ReadProperty <UnityEngine.Rendering.ShadowCastingMode>();
                    break;

                case "receiveShadows":
                    trailRenderer.receiveShadows = reader.ReadProperty <System.Boolean>();
                    break;

                case "material":
                    if (trailRenderer.material == null)
                    {
                        trailRenderer.material = reader.ReadProperty <UnityEngine.Material>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Material>(trailRenderer.material);
                    }
                    break;

                case "sharedMaterial":
                    if (trailRenderer.sharedMaterial == null)
                    {
                        trailRenderer.sharedMaterial = reader.ReadProperty <UnityEngine.Material>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Material>(trailRenderer.sharedMaterial);
                    }
                    break;

                case "materials":
                    trailRenderer.materials = reader.ReadProperty <UnityEngine.Material[]>();
                    break;

                case "sharedMaterials":
                    trailRenderer.sharedMaterials = reader.ReadProperty <UnityEngine.Material[]>();
                    break;

                case "lightmapIndex":
                    trailRenderer.lightmapIndex = reader.ReadProperty <System.Int32>();
                    break;

                case "realtimeLightmapIndex":
                    trailRenderer.realtimeLightmapIndex = reader.ReadProperty <System.Int32>();
                    break;

                case "lightmapScaleOffset":
                    trailRenderer.lightmapScaleOffset = reader.ReadProperty <UnityEngine.Vector4>();
                    break;

                case "motionVectorGenerationMode":
                    trailRenderer.motionVectorGenerationMode = reader.ReadProperty <UnityEngine.MotionVectorGenerationMode>();
                    break;

                case "realtimeLightmapScaleOffset":
                    trailRenderer.realtimeLightmapScaleOffset = reader.ReadProperty <UnityEngine.Vector4>();
                    break;

                case "lightProbeUsage":
                    trailRenderer.lightProbeUsage = reader.ReadProperty <UnityEngine.Rendering.LightProbeUsage>();
                    break;

                case "lightProbeProxyVolumeOverride":
                    if (trailRenderer.lightProbeProxyVolumeOverride == null)
                    {
                        trailRenderer.lightProbeProxyVolumeOverride = reader.ReadProperty <UnityEngine.GameObject>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.GameObject>(trailRenderer.lightProbeProxyVolumeOverride);
                    }
                    break;

                case "probeAnchor":
                    if (trailRenderer.probeAnchor == null)
                    {
                        trailRenderer.probeAnchor = reader.ReadProperty <UnityEngine.Transform>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Transform>(trailRenderer.probeAnchor);
                    }
                    break;

                case "reflectionProbeUsage":
                    trailRenderer.reflectionProbeUsage = reader.ReadProperty <UnityEngine.Rendering.ReflectionProbeUsage>();
                    break;

                case "sortingLayerName":
                    trailRenderer.sortingLayerName = reader.ReadProperty <System.String>();
                    break;

                case "sortingLayerID":
                    trailRenderer.sortingLayerID = reader.ReadProperty <System.Int32>();
                    break;

                case "sortingOrder":
                    trailRenderer.sortingOrder = reader.ReadProperty <System.Int32>();
                    break;

                case "tag":
                    trailRenderer.tag = reader.ReadProperty <System.String>();
                    break;

                case "name":
                    trailRenderer.name = reader.ReadProperty <System.String>();
                    break;

                case "hideFlags":
                    trailRenderer.hideFlags = reader.ReadProperty <UnityEngine.HideFlags>();
                    break;
                }
            }
        }
Пример #8
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.RectTransform rectTransform = (UnityEngine.RectTransform)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "anchorMin":
                    rectTransform.anchorMin = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "anchorMax":
                    rectTransform.anchorMax = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "anchoredPosition3D":
                    rectTransform.anchoredPosition3D = reader.ReadProperty <UnityEngine.Vector3> ();
                    break;

                case "anchoredPosition":
                    rectTransform.anchoredPosition = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "sizeDelta":
                    rectTransform.sizeDelta = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "pivot":
                    rectTransform.pivot = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "offsetMin":
                    rectTransform.offsetMin = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "offsetMax":
                    rectTransform.offsetMax = reader.ReadProperty <UnityEngine.Vector2> ();
                    break;

                case "position":
                    rectTransform.position = reader.ReadProperty <UnityEngine.Vector3> ();
                    break;

                case "localPosition":
                    rectTransform.localPosition = reader.ReadProperty <UnityEngine.Vector3> ();
                    break;

                case "eulerAngles":
                    rectTransform.eulerAngles = reader.ReadProperty <UnityEngine.Vector3> ();
                    break;

                case "localEulerAngles":
                    rectTransform.localEulerAngles = reader.ReadProperty <UnityEngine.Vector3> ();
                    break;

                case "right":
                    rectTransform.right = reader.ReadProperty <UnityEngine.Vector3> ();
                    break;

                case "up":
                    rectTransform.up = reader.ReadProperty <UnityEngine.Vector3> ();
                    break;

                case "forward":
                    rectTransform.forward = reader.ReadProperty <UnityEngine.Vector3> ();
                    break;

                case "rotation":
                    rectTransform.rotation = reader.ReadProperty <UnityEngine.Quaternion> ();
                    break;

                case "localRotation":
                    rectTransform.localRotation = reader.ReadProperty <UnityEngine.Quaternion> ();
                    break;

                case "localScale":
                    rectTransform.localScale = reader.ReadProperty <UnityEngine.Vector3> ();
                    break;

                case "parent":
                    if (rectTransform.parent == null)
                    {
                        rectTransform.parent = reader.ReadProperty <UnityEngine.Transform> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Transform> (rectTransform.parent);
                    }
                    break;

                case "hasChanged":
                    rectTransform.hasChanged = reader.ReadProperty <System.Boolean> ();
                    break;

                case "hierarchyCapacity":
                    rectTransform.hierarchyCapacity = reader.ReadProperty <System.Int32> ();
                    break;

                case "tag":
                    rectTransform.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    rectTransform.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    rectTransform.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Пример #9
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.SpriteMask spriteMask = (UnityEngine.SpriteMask)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "sprite":
                    if (spriteMask.sprite == null)
                    {
                        spriteMask.sprite = reader.ReadProperty <UnityEngine.Sprite>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Sprite>(spriteMask.sprite);
                    }
                    break;

                case "alphaCutoff":
                    spriteMask.alphaCutoff = reader.ReadProperty <System.Single>();
                    break;

                case "isCustomRangeActive":
                    spriteMask.isCustomRangeActive = reader.ReadProperty <System.Boolean>();
                    break;

                case "frontSortingLayerID":
                    spriteMask.frontSortingLayerID = reader.ReadProperty <System.Int32>();
                    break;

                case "frontSortingOrder":
                    spriteMask.frontSortingOrder = reader.ReadProperty <System.Int32>();
                    break;

                case "backSortingLayerID":
                    spriteMask.backSortingLayerID = reader.ReadProperty <System.Int32>();
                    break;

                case "backSortingOrder":
                    spriteMask.backSortingOrder = reader.ReadProperty <System.Int32>();
                    break;

                case "enabled":
                    spriteMask.enabled = reader.ReadProperty <System.Boolean>();
                    break;

                case "shadowCastingMode":
                    spriteMask.shadowCastingMode = reader.ReadProperty <UnityEngine.Rendering.ShadowCastingMode>();
                    break;

                case "receiveShadows":
                    spriteMask.receiveShadows = reader.ReadProperty <System.Boolean>();
                    break;

                case "material":
                    if (spriteMask.material == null)
                    {
                        spriteMask.material = reader.ReadProperty <UnityEngine.Material>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Material>(spriteMask.material);
                    }
                    break;

                case "sharedMaterial":
                    if (spriteMask.sharedMaterial == null)
                    {
                        spriteMask.sharedMaterial = reader.ReadProperty <UnityEngine.Material>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Material>(spriteMask.sharedMaterial);
                    }
                    break;

                case "materials":
                    spriteMask.materials = reader.ReadProperty <UnityEngine.Material[]>();
                    break;

                case "sharedMaterials":
                    spriteMask.sharedMaterials = reader.ReadProperty <UnityEngine.Material[]>();
                    break;

                case "lightmapIndex":
                    spriteMask.lightmapIndex = reader.ReadProperty <System.Int32>();
                    break;

                case "realtimeLightmapIndex":
                    spriteMask.realtimeLightmapIndex = reader.ReadProperty <System.Int32>();
                    break;

                case "lightmapScaleOffset":
                    spriteMask.lightmapScaleOffset = reader.ReadProperty <UnityEngine.Vector4>();
                    break;

                case "motionVectorGenerationMode":
                    spriteMask.motionVectorGenerationMode = reader.ReadProperty <UnityEngine.MotionVectorGenerationMode>();
                    break;

                case "realtimeLightmapScaleOffset":
                    spriteMask.realtimeLightmapScaleOffset = reader.ReadProperty <UnityEngine.Vector4>();
                    break;

                case "lightProbeUsage":
                    spriteMask.lightProbeUsage = reader.ReadProperty <UnityEngine.Rendering.LightProbeUsage>();
                    break;

                case "lightProbeProxyVolumeOverride":
                    if (spriteMask.lightProbeProxyVolumeOverride == null)
                    {
                        spriteMask.lightProbeProxyVolumeOverride = reader.ReadProperty <UnityEngine.GameObject>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.GameObject>(spriteMask.lightProbeProxyVolumeOverride);
                    }
                    break;

                case "probeAnchor":
                    if (spriteMask.probeAnchor == null)
                    {
                        spriteMask.probeAnchor = reader.ReadProperty <UnityEngine.Transform>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Transform>(spriteMask.probeAnchor);
                    }
                    break;

                case "reflectionProbeUsage":
                    spriteMask.reflectionProbeUsage = reader.ReadProperty <UnityEngine.Rendering.ReflectionProbeUsage>();
                    break;

                case "sortingLayerName":
                    spriteMask.sortingLayerName = reader.ReadProperty <System.String>();
                    break;

                case "sortingLayerID":
                    spriteMask.sortingLayerID = reader.ReadProperty <System.Int32>();
                    break;

                case "sortingOrder":
                    spriteMask.sortingOrder = reader.ReadProperty <System.Int32>();
                    break;

                case "tag":
                    spriteMask.tag = reader.ReadProperty <System.String>();
                    break;

                case "name":
                    spriteMask.name = reader.ReadProperty <System.String>();
                    break;

                case "hideFlags":
                    spriteMask.hideFlags = reader.ReadProperty <UnityEngine.HideFlags>();
                    break;
                }
            }
        }
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.TextMesh textMesh = (UnityEngine.TextMesh)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "text":
                    textMesh.text = reader.ReadProperty <System.String> ();
                    break;

                case "font":
                    if (textMesh.font == null)
                    {
                        textMesh.font = reader.ReadProperty <UnityEngine.Font> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Font> (textMesh.font);
                    }
                    break;

                case "fontSize":
                    textMesh.fontSize = reader.ReadProperty <System.Int32> ();
                    break;

                case "fontStyle":
                    textMesh.fontStyle = reader.ReadProperty <UnityEngine.FontStyle> ();
                    break;

                case "offsetZ":
                    textMesh.offsetZ = reader.ReadProperty <System.Single> ();
                    break;

                case "alignment":
                    textMesh.alignment = reader.ReadProperty <UnityEngine.TextAlignment> ();
                    break;

                case "anchor":
                    textMesh.anchor = reader.ReadProperty <UnityEngine.TextAnchor> ();
                    break;

                case "characterSize":
                    textMesh.characterSize = reader.ReadProperty <System.Single> ();
                    break;

                case "lineSpacing":
                    textMesh.lineSpacing = reader.ReadProperty <System.Single> ();
                    break;

                case "tabSize":
                    textMesh.tabSize = reader.ReadProperty <System.Single> ();
                    break;

                case "richText":
                    textMesh.richText = reader.ReadProperty <System.Boolean> ();
                    break;

                case "color":
                    textMesh.color = reader.ReadProperty <UnityEngine.Color> ();
                    break;

                case "tag":
                    textMesh.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    textMesh.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    textMesh.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Пример #11
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.Terrain terrain = (UnityEngine.Terrain)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "terrainData":
                    if (terrain.terrainData == null)
                    {
                        terrain.terrainData = reader.ReadProperty <UnityEngine.TerrainData>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.TerrainData>(terrain.terrainData);
                    }
                    break;

                case "treeDistance":
                    terrain.treeDistance = reader.ReadProperty <System.Single>();
                    break;

                case "treeBillboardDistance":
                    terrain.treeBillboardDistance = reader.ReadProperty <System.Single>();
                    break;

                case "treeCrossFadeLength":
                    terrain.treeCrossFadeLength = reader.ReadProperty <System.Single>();
                    break;

                case "treeMaximumFullLODCount":
                    terrain.treeMaximumFullLODCount = reader.ReadProperty <System.Int32>();
                    break;

                case "detailObjectDistance":
                    terrain.detailObjectDistance = reader.ReadProperty <System.Single>();
                    break;

                case "detailObjectDensity":
                    terrain.detailObjectDensity = reader.ReadProperty <System.Single>();
                    break;

                case "heightmapPixelError":
                    terrain.heightmapPixelError = reader.ReadProperty <System.Single>();
                    break;

                case "heightmapMaximumLOD":
                    terrain.heightmapMaximumLOD = reader.ReadProperty <System.Int32>();
                    break;

                case "basemapDistance":
                    terrain.basemapDistance = reader.ReadProperty <System.Single>();
                    break;

                case "lightmapIndex":
                    terrain.lightmapIndex = reader.ReadProperty <System.Int32>();
                    break;

                case "realtimeLightmapIndex":
                    terrain.realtimeLightmapIndex = reader.ReadProperty <System.Int32>();
                    break;

                case "lightmapScaleOffset":
                    terrain.lightmapScaleOffset = reader.ReadProperty <UnityEngine.Vector4>();
                    break;

                case "realtimeLightmapScaleOffset":
                    terrain.realtimeLightmapScaleOffset = reader.ReadProperty <UnityEngine.Vector4>();
                    break;

                case "castShadows":
                    terrain.castShadows = reader.ReadProperty <System.Boolean>();
                    break;

                case "reflectionProbeUsage":
                    terrain.reflectionProbeUsage = reader.ReadProperty <UnityEngine.Rendering.ReflectionProbeUsage>();
                    break;

                case "materialType":
                    terrain.materialType = reader.ReadProperty <UnityEngine.Terrain.MaterialType>();
                    break;

                case "materialTemplate":
                    if (terrain.materialTemplate == null)
                    {
                        terrain.materialTemplate = reader.ReadProperty <UnityEngine.Material>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Material>(terrain.materialTemplate);
                    }
                    break;

                case "legacySpecular":
                    terrain.legacySpecular = reader.ReadProperty <UnityEngine.Color>();
                    break;

                case "legacyShininess":
                    terrain.legacyShininess = reader.ReadProperty <System.Single>();
                    break;

                case "drawHeightmap":
                    terrain.drawHeightmap = reader.ReadProperty <System.Boolean>();
                    break;

                case "drawTreesAndFoliage":
                    terrain.drawTreesAndFoliage = reader.ReadProperty <System.Boolean>();
                    break;

                case "patchBoundsMultiplier":
#if UNITY_2017_1_OR_NEWER
                    terrain.patchBoundsMultiplier = reader.ReadProperty <UnityEngine.Vector3>();
#else
                    reader.ReadProperty <UnityEngine.Vector3>();
#endif
                    break;

                case "treeLODBiasMultiplier":
                    terrain.treeLODBiasMultiplier = reader.ReadProperty <System.Single>();
                    break;

                case "collectDetailPatches":
                    terrain.collectDetailPatches = reader.ReadProperty <System.Boolean>();
                    break;

                case "editorRenderFlags":
                    terrain.editorRenderFlags = reader.ReadProperty <UnityEngine.TerrainRenderFlags>();
                    break;

                case "enabled":
                    terrain.enabled = reader.ReadProperty <System.Boolean>();
                    break;

                case "tag":
                    terrain.tag = reader.ReadProperty <System.String>();
                    break;

                case "name":
                    terrain.name = reader.ReadProperty <System.String>();
                    break;

                case "hideFlags":
                    terrain.hideFlags = reader.ReadProperty <UnityEngine.HideFlags>();
                    break;
                }
            }
        }
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.Animator animator = (UnityEngine.Animator)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "rootPosition":
                    animator.rootPosition = reader.ReadProperty <UnityEngine.Vector3>();
                    break;

                case "rootRotation":
                    animator.rootRotation = reader.ReadProperty <UnityEngine.Quaternion>();
                    break;

                case "applyRootMotion":
                    animator.applyRootMotion = reader.ReadProperty <System.Boolean>();
                    break;

                case "linearVelocityBlending":
                    animator.linearVelocityBlending = reader.ReadProperty <System.Boolean>();
                    break;

                case "updateMode":
                    animator.updateMode = reader.ReadProperty <UnityEngine.AnimatorUpdateMode>();
                    break;

                case "bodyPosition":
                    animator.bodyPosition = reader.ReadProperty <UnityEngine.Vector3>();
                    break;

                case "bodyRotation":
                    animator.bodyRotation = reader.ReadProperty <UnityEngine.Quaternion>();
                    break;

                case "stabilizeFeet":
                    animator.stabilizeFeet = reader.ReadProperty <System.Boolean>();
                    break;

                case "feetPivotActive":
                    animator.feetPivotActive = reader.ReadProperty <System.Single>();
                    break;

                case "speed":
                    animator.speed = reader.ReadProperty <System.Single>();
                    break;

                case "cullingMode":
                    animator.cullingMode = reader.ReadProperty <UnityEngine.AnimatorCullingMode>();
                    break;

                case "playbackTime":
                    animator.playbackTime = reader.ReadProperty <System.Single>();
                    break;

                case "recorderStartTime":
                    animator.recorderStartTime = reader.ReadProperty <System.Single>();
                    break;

                case "recorderStopTime":
                    animator.recorderStopTime = reader.ReadProperty <System.Single>();
                    break;

                case "runtimeAnimatorController":
                    if (animator.runtimeAnimatorController == null)
                    {
                        animator.runtimeAnimatorController = reader.ReadProperty <UnityEngine.RuntimeAnimatorController>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.RuntimeAnimatorController>(animator.runtimeAnimatorController);
                    }
                    break;

                case "avatar":
                    if (animator.avatar == null)
                    {
                        animator.avatar = reader.ReadProperty <UnityEngine.Avatar>();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Avatar>(animator.avatar);
                    }
                    break;

                case "layersAffectMassCenter":
                    animator.layersAffectMassCenter = reader.ReadProperty <System.Boolean>();
                    break;

                case "logWarnings":
                    animator.logWarnings = reader.ReadProperty <System.Boolean>();
                    break;

                case "fireEvents":
                    animator.fireEvents = reader.ReadProperty <System.Boolean>();
                    break;

                case "enabled":
                    animator.enabled = reader.ReadProperty <System.Boolean>();
                    break;

                case "tag":
                    animator.tag = reader.ReadProperty <System.String>();
                    break;

                case "name":
                    animator.name = reader.ReadProperty <System.String>();
                    break;

                case "hideFlags":
                    animator.hideFlags = reader.ReadProperty <UnityEngine.HideFlags>();
                    break;
                }
            }
        }
Пример #13
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.Light light = (UnityEngine.Light)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "type":
                    light.type = reader.ReadProperty <UnityEngine.LightType> ();
                    break;

                case "color":
                    light.color = reader.ReadProperty <UnityEngine.Color> ();
                    break;

                case "colorTemperature":
                    light.colorTemperature = reader.ReadProperty <System.Single> ();
                    break;

                case "intensity":
                    light.intensity = reader.ReadProperty <System.Single> ();
                    break;

                case "bounceIntensity":
                    light.bounceIntensity = reader.ReadProperty <System.Single> ();
                    break;

                case "shadows":
                    light.shadows = reader.ReadProperty <UnityEngine.LightShadows> ();
                    break;

                case "shadowStrength":
                    light.shadowStrength = reader.ReadProperty <System.Single> ();
                    break;

                case "shadowResolution":
                    light.shadowResolution = reader.ReadProperty <UnityEngine.Rendering.LightShadowResolution> ();
                    break;

                case "shadowCustomResolution":
                    light.shadowCustomResolution = reader.ReadProperty <System.Int32> ();
                    break;

                case "shadowBias":
                    light.shadowBias = reader.ReadProperty <System.Single> ();
                    break;

                case "shadowNormalBias":
                    light.shadowNormalBias = reader.ReadProperty <System.Single> ();
                    break;

                case "shadowNearPlane":
                    light.shadowNearPlane = reader.ReadProperty <System.Single> ();
                    break;

                case "range":
                    light.range = reader.ReadProperty <System.Single> ();
                    break;

                case "spotAngle":
                    light.spotAngle = reader.ReadProperty <System.Single> ();
                    break;

                case "cookieSize":
                    light.cookieSize = reader.ReadProperty <System.Single> ();
                    break;

                case "cookie":
                    if (light.cookie == null)
                    {
                        light.cookie = reader.ReadProperty <UnityEngine.Texture> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Texture> (light.cookie);
                    }
                    break;

                case "flare":
                    if (light.flare == null)
                    {
                        light.flare = reader.ReadProperty <UnityEngine.Flare> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Flare> (light.flare);
                    }
                    break;

                case "renderMode":
                    light.renderMode = reader.ReadProperty <UnityEngine.LightRenderMode> ();
                    break;

                case "alreadyLightmapped":
                                                #if UNITY_2017_3_OR_NEWER
                    LightBakingOutput bakingOutput = light.bakingOutput;
                    bakingOutput.isBaked = reader.ReadProperty <System.Boolean> ();
                    light.bakingOutput   = bakingOutput;
                                                #else
                    light.alreadyLightmapped = reader.ReadProperty <System.Boolean> ();
                                                #endif
                    break;

                case "cullingMask":
                    light.cullingMask = reader.ReadProperty <System.Int32> ();
                    break;

                case "enabled":
                    light.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    light.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    light.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    light.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.UI.FontData fontData = (UnityEngine.UI.FontData)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "font":
                    if (fontData.font == null)
                    {
                        fontData.font = reader.ReadProperty <UnityEngine.Font> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Font> (fontData.font);
                    }
                    break;

                case "fontSize":
                    fontData.fontSize = reader.ReadProperty <System.Int32> ();
                    break;

                case "fontStyle":
                    fontData.fontStyle = reader.ReadProperty <UnityEngine.FontStyle> ();
                    break;

                case "bestFit":
                    fontData.bestFit = reader.ReadProperty <System.Boolean> ();
                    break;

                case "minSize":
                    fontData.minSize = reader.ReadProperty <System.Int32> ();
                    break;

                case "maxSize":
                    fontData.maxSize = reader.ReadProperty <System.Int32> ();
                    break;

                case "alignment":
                    fontData.alignment = reader.ReadProperty <UnityEngine.TextAnchor> ();
                    break;

                case "alignByGeometry":
                    fontData.alignByGeometry = reader.ReadProperty <System.Boolean> ();
                    break;

                case "richText":
                    fontData.richText = reader.ReadProperty <System.Boolean> ();
                    break;

                case "horizontalOverflow":
                    fontData.horizontalOverflow = reader.ReadProperty <UnityEngine.HorizontalWrapMode> ();
                    break;

                case "verticalOverflow":
                    fontData.verticalOverflow = reader.ReadProperty <UnityEngine.VerticalWrapMode> ();
                    break;

                case "lineSpacing":
                    fontData.lineSpacing = reader.ReadProperty <System.Single> ();
                    break;
                }
            }
        }
Пример #15
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.UI.Scrollbar scrollbar = (UnityEngine.UI.Scrollbar)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "handleRect":
                    if (scrollbar.handleRect == null)
                    {
                        scrollbar.handleRect = reader.ReadProperty <UnityEngine.RectTransform> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.RectTransform> (scrollbar.handleRect);
                    }
                    break;

                case "direction":
                    scrollbar.direction = reader.ReadProperty <UnityEngine.UI.Scrollbar.Direction> ();
                    break;

                case "value":
                    scrollbar.value = reader.ReadProperty <System.Single> ();
                    break;

                case "size":
                    scrollbar.size = reader.ReadProperty <System.Single> ();
                    break;

                case "numberOfSteps":
                    scrollbar.numberOfSteps = reader.ReadProperty <System.Int32> ();
                    break;

                case "navigation":
                    scrollbar.navigation = reader.ReadProperty <UnityEngine.UI.Navigation> ();
                    break;

                case "transition":
                    scrollbar.transition = reader.ReadProperty <UnityEngine.UI.Selectable.Transition> ();
                    break;

                case "colors":
                    scrollbar.colors = reader.ReadProperty <UnityEngine.UI.ColorBlock> ();
                    break;

                case "spriteState":
                    scrollbar.spriteState = reader.ReadProperty <UnityEngine.UI.SpriteState> ();
                    break;

                case "animationTriggers":
                    scrollbar.animationTriggers = reader.ReadProperty <UnityEngine.UI.AnimationTriggers> ();
                    break;

                case "targetGraphic":
                    Type targetGraphicType = Type.GetType(reader.ReadProperty <System.String> ());
                    if (scrollbar.targetGraphic == null)
                    {
                        scrollbar.targetGraphic = (UnityEngine.UI.Graphic)reader.ReadProperty(targetGraphicType);
                    }
                    else
                    {
                        reader.ReadIntoProperty(scrollbar.targetGraphic);
                    }
                    break;

                case "interactable":
                    scrollbar.interactable = reader.ReadProperty <System.Boolean> ();
                    break;

                case "image":
                    if (scrollbar.image == null)
                    {
                        scrollbar.image = reader.ReadProperty <UnityEngine.UI.Image> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.UI.Image> (scrollbar.image);
                    }
                    break;

                case "useGUILayout":
                    scrollbar.useGUILayout = reader.ReadProperty <System.Boolean> ();
                    break;

                case "enabled":
                    scrollbar.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    scrollbar.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    scrollbar.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    scrollbar.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Пример #16
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.UI.InputField inputField = (UnityEngine.UI.InputField)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "shouldHideMobileInput":
                    inputField.shouldHideMobileInput = reader.ReadProperty <System.Boolean> ();
                    break;

                case "text":
                    inputField.text = reader.ReadProperty <System.String> ();
                    break;

                case "caretBlinkRate":
                    inputField.caretBlinkRate = reader.ReadProperty <System.Single> ();
                    break;

                case "caretWidth":
                    inputField.caretWidth = reader.ReadProperty <System.Int32> ();
                    break;

                case "textComponent":
                    if (inputField.textComponent == null)
                    {
                        inputField.textComponent = reader.ReadProperty <UnityEngine.UI.Text> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.UI.Text> (inputField.textComponent);
                    }
                    break;

                case "placeholder":
                    Type placeholderType = Type.GetType(reader.ReadProperty <System.String> ());
                    if (inputField.placeholder == null)
                    {
                        inputField.placeholder = (UnityEngine.UI.Graphic)reader.ReadProperty(placeholderType);
                    }
                    else
                    {
                        reader.ReadIntoProperty(inputField.placeholder);
                    }
                    break;

                case "caretColor":
                    inputField.caretColor = reader.ReadProperty <UnityEngine.Color> ();
                    break;

                case "customCaretColor":
                    inputField.customCaretColor = reader.ReadProperty <System.Boolean> ();
                    break;

                case "selectionColor":
                    inputField.selectionColor = reader.ReadProperty <UnityEngine.Color> ();
                    break;

                case "characterLimit":
                    inputField.characterLimit = reader.ReadProperty <System.Int32> ();
                    break;

                case "contentType":
                    inputField.contentType = reader.ReadProperty <UnityEngine.UI.InputField.ContentType> ();
                    break;

                case "lineType":
                    inputField.lineType = reader.ReadProperty <UnityEngine.UI.InputField.LineType> ();
                    break;

                case "inputType":
                    inputField.inputType = reader.ReadProperty <UnityEngine.UI.InputField.InputType> ();
                    break;

                case "keyboardType":
                    inputField.keyboardType = reader.ReadProperty <UnityEngine.TouchScreenKeyboardType> ();
                    break;

                case "characterValidation":
                    inputField.characterValidation = reader.ReadProperty <UnityEngine.UI.InputField.CharacterValidation> ();
                    break;

                case "readOnly":
                    inputField.readOnly = reader.ReadProperty <System.Boolean> ();
                    break;

                case "asteriskChar":
                    inputField.asteriskChar = reader.ReadProperty <System.Char> ();
                    break;

                case "caretPosition":
                    inputField.caretPosition = reader.ReadProperty <System.Int32> ();
                    break;

                case "selectionAnchorPosition":
                    inputField.selectionAnchorPosition = reader.ReadProperty <System.Int32> ();
                    break;

                case "selectionFocusPosition":
                    inputField.selectionFocusPosition = reader.ReadProperty <System.Int32> ();
                    break;

                case "navigation":
                    inputField.navigation = reader.ReadProperty <UnityEngine.UI.Navigation> ();
                    break;

                case "transition":
                    inputField.transition = reader.ReadProperty <UnityEngine.UI.Selectable.Transition> ();
                    break;

                case "colors":
                    inputField.colors = reader.ReadProperty <UnityEngine.UI.ColorBlock> ();
                    break;

                case "spriteState":
                    inputField.spriteState = reader.ReadProperty <UnityEngine.UI.SpriteState> ();
                    break;

                case "animationTriggers":
                    inputField.animationTriggers = reader.ReadProperty <UnityEngine.UI.AnimationTriggers> ();
                    break;

                case "targetGraphic":
                    Type targetGraphicType = Type.GetType(reader.ReadProperty <System.String> ());
                    if (inputField.targetGraphic == null)
                    {
                        inputField.targetGraphic = (UnityEngine.UI.Graphic)reader.ReadProperty(targetGraphicType);
                    }
                    else
                    {
                        reader.ReadIntoProperty(inputField.targetGraphic);
                    }
                    break;

                case "interactable":
                    inputField.interactable = reader.ReadProperty <System.Boolean> ();
                    break;

                case "image":
                    if (inputField.image == null)
                    {
                        inputField.image = reader.ReadProperty <UnityEngine.UI.Image> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.UI.Image> (inputField.image);
                    }
                    break;

                case "useGUILayout":
                    inputField.useGUILayout = reader.ReadProperty <System.Boolean> ();
                    break;

                case "enabled":
                    inputField.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    inputField.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    inputField.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    inputField.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }