Beispiel #1
0
        public BlendTreeNodeConstant(ObjectReader reader)
        {
            var version = reader.version;

            m_BlendType     = reader.ReadUInt32();
            m_BlendEventID  = reader.ReadUInt32();
            m_BlendEventYID = reader.ReadUInt32();
            m_ChildIndices  = reader.ReadUInt32Array(reader.ReadInt32());
            m_Blend1dData   = new Blend1dDataConstant(reader);
            m_Blend2dData   = new Blend2dDataConstant(reader);
            if (version[0] >= 5) //5.0 and up
            {
                m_BlendDirectData = new BlendDirectDataConstant(reader);
            }

            m_ClipID = reader.ReadUInt32();
            if (version[0] < 5) //5.0 down
            {
                m_ClipIndex = reader.ReadUInt32();
            }

            m_Duration    = reader.ReadSingle();
            m_CycleOffset = reader.ReadSingle();
            m_Mirror      = reader.ReadBoolean();
            reader.AlignStream(4);
        }
Beispiel #2
0
        public BlendTreeNodeConstant(ObjectReader reader)
        {
            var version = reader.version;

            if (version[0] > 4 || (version[0] == 4 && version[1] >= 1)) //4.1 and up
            {
                m_BlendType = reader.ReadUInt32();
            }
            m_BlendEventID = reader.ReadUInt32();
            if (version[0] > 4 || (version[0] == 4 && version[1] >= 1)) //4.1 and up
            {
                m_BlendEventYID = reader.ReadUInt32();
            }
            m_ChildIndices = reader.ReadUInt32Array();
            if (version[0] < 4 || (version[0] == 4 && version[1] < 1)) //4.1 down
            {
                m_ChildThresholdArray = reader.ReadSingleArray();
            }

            if (version[0] > 4 || (version[0] == 4 && version[1] >= 1)) //4.1 and up
            {
                m_Blend1dData = new Blend1dDataConstant(reader);
                m_Blend2dData = new Blend2dDataConstant(reader);
            }

            if (version[0] >= 5) //5.0 and up
            {
                m_BlendDirectData = new BlendDirectDataConstant(reader);
            }

            m_ClipID = reader.ReadUInt32();
            if (version[0] == 4 && version[1] >= 5) //4.5 - 5.0
            {
                m_ClipIndex = reader.ReadUInt32();
            }

            m_Duration = reader.ReadSingle();

            if (version[0] > 4 ||
                (version[0] == 4 && version[1] > 1) ||
                (version[0] == 4 && version[1] == 1 && version[2] >= 3))    //4.1.3 and up
            {
                m_CycleOffset = reader.ReadSingle();
                m_Mirror      = reader.ReadBoolean();
                reader.AlignStream();
            }
        }