Example #1
0
 public override void Deserialize(BinaryReader binaryReader)
 {
     base.Deserialize(binaryReader);
     clearFlags            = (CameraClearFlags)binaryReader.ReadInt32();
     cullingMask           = binaryReader.ReadInt32();
     orthographic          = binaryReader.ReadBoolean();
     orthographicSize      = binaryReader.ReadSingle();
     fieldOfView           = binaryReader.ReadSingle();
     usePhysicalProperties = binaryReader.ReadBoolean();
     focalLength           = binaryReader.ReadSingle();
     sensorType            = binaryReader.ReadInt32();
     gateFit                = (Camera.GateFitMode)binaryReader.ReadInt32();
     nearClipPlane          = binaryReader.ReadSingle();
     farClipPlane           = binaryReader.ReadSingle();
     depth                  = binaryReader.ReadSingle();
     renderingPath          = binaryReader.ReadInt32();
     useOcclusionCulling    = binaryReader.ReadBoolean();
     allowHDR               = binaryReader.ReadBoolean();
     allowMSAA              = binaryReader.ReadBoolean();
     allowDynamicResolution = binaryReader.ReadBoolean();
     targetEye              = binaryReader.ReadInt32();
     m_backgroundColor      = SerializerKun.DesirializeObject <ColorKun>(binaryReader);
     m_lensShift            = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader);
     m_rect                 = SerializerKun.DesirializeObject <RectKun>(binaryReader);
 }
Example #2
0
 public Property()
 {
     m_description        = "";
     m_name               = "";
     m_rangeLimits        = new Vector2Kun();
     m_textureDefaultName = "";
     m_defaultVectorValue = new Vector4Kun();
 }
Example #3
0
 public Property()
 {
     dirty          = false;
     m_colorValue   = new ColorKun();
     m_textureValue = new TextureKun();
     m_vectorValue  = new Vector4Kun();
     m_scale        = new Vector2Kun();
     m_offset       = new Vector2Kun();
 }
Example #4
0
 public SpriteKun(Sprite sprite) : base(sprite)
 {
     if (sprite != null)
     {
         name   = sprite.name;
         pivot  = new Vector2Kun(sprite.pivot);
         border = new Vector4Kun(sprite.border);
     }
     else
     {
         pivot  = new Vector2Kun();
         border = new Vector4Kun();
     }
 }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public override bool Equals(object other)
        {
            Vector2Kun v2 = other as Vector2Kun;

            if (other == null)
            {
                return(false);
            }
            if (x != v2.x || y != v2.y)
            {
                return(false);
            }
            return(true);
        }
Example #6
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="binaryReader"></param>
            public virtual void Deserialize(BinaryReader binaryReader)
            {
                m_flags              = (UnityEngine.Rendering.ShaderPropertyFlags)binaryReader.ReadUInt32();
                m_textureDimension   = (UnityEngine.Rendering.TextureDimension)binaryReader.ReadInt32();
                m_type               = (UnityEngine.Rendering.ShaderPropertyType)binaryReader.ReadInt32();
                m_description        = binaryReader.ReadString();
                m_name               = binaryReader.ReadString();
                m_textureDefaultName = binaryReader.ReadString();
                m_nameId             = binaryReader.ReadInt32();
                m_defaultFloatValue  = binaryReader.ReadSingle();

                m_attributes         = SerializerKun.DesirializeStrings(binaryReader);
                m_rangeLimits        = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader);
                m_defaultVectorValue = SerializerKun.DesirializeObject <Vector4Kun>(binaryReader);
            }
Example #7
0
            public virtual void Deserialize(BinaryReader binaryReader)
            {
#if UNITY_2019_1_OR_NEWER
                m_flags = (UnityEngine.Rendering.ShaderPropertyFlags)binaryReader.ReadInt32();
                m_type  = (UnityEngine.Rendering.ShaderPropertyType)binaryReader.ReadInt32();
#endif
                m_textureDimension = (UnityEngine.Rendering.TextureDimension)binaryReader.ReadInt32();
                m_dirty            = binaryReader.ReadBoolean();
                m_nameId           = binaryReader.ReadInt32();
                m_floatValue       = binaryReader.ReadSingle();
                m_displayName      = binaryReader.ReadString();
                m_name             = binaryReader.ReadString();
                m_colorValue       = SerializerKun.DesirializeObject <ColorKun>(binaryReader);
                m_textureValue     = SerializerKun.DesirializeObject <TextureKun>(binaryReader);
                m_rangeLimits      = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader);
                m_scale            = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader);
                m_offset           = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader);
                m_vectorValue      = SerializerKun.DesirializeObject <Vector4Kun>(binaryReader);
            }
Example #8
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="component">Cameraオブジェクト</param>
        public CameraKun(Component component) : base(component)
        {
            componentKunType  = ComponentKunType.Camera;
            m_backgroundColor = new ColorKun();
            m_lensShift       = new Vector2Kun();
            m_rect            = new RectKun();

            var camera = component as Camera;

            if (camera != null)
            {
                enabled               = camera.enabled;
                clearFlags            = camera.clearFlags;
                backgroundColor       = camera.backgroundColor;
                cullingMask           = camera.cullingMask;
                orthographic          = camera.orthographic;
                orthographicSize      = camera.orthographicSize;
                fieldOfView           = camera.fieldOfView;
                usePhysicalProperties = camera.usePhysicalProperties;
                focalLength           = camera.focalLength;

                sensorType = System.Array.IndexOf(k_ApertureFormatValues, new Vector2((float)System.Math.Round(camera.sensorSize.x, 3), (float)System.Math.Round(camera.sensorSize.y, 3)));
                lensShift  = camera.lensShift;
                gateFit    = camera.gateFit;

                nearClipPlane          = camera.nearClipPlane;
                farClipPlane           = camera.farClipPlane;
                rect                   = camera.rect;
                depth                  = camera.depth;
                renderingPath          = (int)camera.renderingPath;
                useOcclusionCulling    = camera.useOcclusionCulling;
                allowHDR               = camera.allowHDR;
                allowMSAA              = camera.allowMSAA;
                allowDynamicResolution = camera.allowDynamicResolution;
                targetEye              = (int)camera.stereoTargetEye;
            }
        }
Example #9
0
            public override bool Equals(object obj)
            {
                var other = obj as Property;

                if (other == null)
                {
                    return(false);
                }
#if UNITY_2019_1_OR_NEWER
                if (flags.Equals(other.flags) == false)
                {
                    return(false);
                }
                if (type.Equals(other.type) == false)
                {
                    return(false);
                }
#endif
                if (dirty.Equals(other.dirty) == false)
                {
                    return(false);
                }

                if (!ColorKun.Equals(m_colorValue, other.m_colorValue))
                {
                    return(false);
                }

                if (!string.Equals(displayName, other.displayName))
                {
                    return(false);
                }

                if (floatValue.Equals(other.floatValue) == false)
                {
                    return(false);
                }

                if (!string.Equals(name, other.name))
                {
                    return(false);
                }
                if (nameId.Equals(other.nameId) == false)
                {
                    return(false);
                }

                if (!Vector2Kun.Equals(m_rangeLimits, other.m_rangeLimits))
                {
                    return(false);
                }

                if (textureDimension.Equals(other.textureDimension) == false)
                {
                    return(false);
                }

                if (!TextureKun.Equals(m_textureValue, other.m_textureValue))
                {
                    return(false);
                }

                if (!Vector4Kun.Equals(m_vectorValue, other.m_vectorValue))
                {
                    return(false);
                }

                if (!Vector2Kun.Equals(m_scale, other.m_scale))
                {
                    return(false);
                }

                if (!Vector2Kun.Equals(m_offset, other.m_offset))
                {
                    return(false);
                }
                return(true);
            }
Example #10
0
 public override void Deserialize(BinaryReader binaryReader)
 {
     base.Deserialize(binaryReader);
     pivot  = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader);
     border = SerializerKun.DesirializeObject <Vector4Kun>(binaryReader);
 }