Ejemplo n.º 1
0
        public void LoadFrom(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream);

            m_Name           = reader.ReadNameA4U8();
            m_ControllerSize = reader.ReadUInt32();
            m_Controller     = new ControllerConstant(stream, file.VersionNumber);

            int tosSize = reader.ReadInt32();

            m_TOS = new List <KeyValuePair <uint, string> >(tosSize);
            for (int i = 0; i < tosSize; i++)
            {
                m_TOS.Add(new KeyValuePair <uint, string>(reader.ReadUInt32(), reader.ReadNameA4U8()));
            }

            int numClips = reader.ReadInt32();

            m_AnimationClips = new List <PPtr <AnimationClip> >(numClips);
            for (int i = 0; i < numClips; i++)
            {
                m_AnimationClips.Add(new PPtr <AnimationClip>(stream, file));
            }

            if (file.VersionNumber >= AssetCabinet.VERSION_5_0_0)
            {
                m_StateMachineBehaviourVectorDescription = new StateMachineBehaviourVectorDescription(stream);

                int numMBs = reader.ReadInt32();
                m_StateMachineBehaviours = new PPtr <MonoBehaviour> [numMBs];
                for (int i = 0; i < numMBs; i++)
                {
                    m_StateMachineBehaviours[i] = new PPtr <MonoBehaviour>(stream, file);
                }

                if (file.VersionNumber >= AssetCabinet.VERSION_5_4_1)
                {
                    m_MultiThreadedStateMachine = reader.ReadBoolean();
                    stream.Position            += 3;
                }
            }
        }
Ejemplo n.º 2
0
        public void LoadFrom(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream);

            m_Name           = reader.ReadNameA4();
            m_ControllerSize = reader.ReadUInt32();
            m_Controller     = new ControllerConstant(stream);

            int tosSize = reader.ReadInt32();

            m_TOS = new List <KeyValuePair <uint, string> >(tosSize);
            for (int i = 0; i < tosSize; i++)
            {
                m_TOS.Add(new KeyValuePair <uint, string>(reader.ReadUInt32(), reader.ReadNameA4()));
            }

            int numClips = reader.ReadInt32();

            m_AnimationClips = new List <PPtr <AnimationClip> >(numClips);
            for (int i = 0; i < numClips; i++)
            {
                m_AnimationClips.Add(new PPtr <AnimationClip>(stream, file));
            }
        }
Ejemplo n.º 3
0
        public void LoadFrom(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream);
            m_Name = reader.ReadNameA4();
            m_ControllerSize = reader.ReadUInt32();
            m_Controller = new ControllerConstant(stream);

            int tosSize = reader.ReadInt32();
            m_TOS = new List<KeyValuePair<uint, string>>(tosSize);
            for (int i = 0; i < tosSize; i++)
            {
                m_TOS.Add(new KeyValuePair<uint, string>(reader.ReadUInt32(), reader.ReadNameA4()));
            }

            int numClips = reader.ReadInt32();
            m_AnimationClips = new List<PPtr<AnimationClip>>(numClips);
            for (int i = 0; i < numClips; i++)
            {
                m_AnimationClips.Add(new PPtr<AnimationClip>(stream, file));
            }
        }