Example #1
0
        public UnityPropertySheet(ObjectReader reader)
        {
            int m_TexEnvsSize = reader.ReadInt32();

            m_TexEnvs = new KeyValuePair <string, UnityTexEnv> [m_TexEnvsSize];
            for (int i = 0; i < m_TexEnvsSize; i++)
            {
                m_TexEnvs[i] = new KeyValuePair <string, UnityTexEnv>(reader.ReadAlignedString(), new UnityTexEnv(reader));
            }

            int m_FloatsSize = reader.ReadInt32();

            m_Floats = new KeyValuePair <string, float> [m_FloatsSize];
            for (int i = 0; i < m_FloatsSize; i++)
            {
                m_Floats[i] = new KeyValuePair <string, float>(reader.ReadAlignedString(), reader.ReadSingle());
            }

            int m_ColorsSize = reader.ReadInt32();

            m_Colors = new KeyValuePair <string, Color> [m_ColorsSize];
            for (int i = 0; i < m_ColorsSize; i++)
            {
                m_Colors[i] = new KeyValuePair <string, Color>(reader.ReadAlignedString(), reader.ReadColor4());
            }
        }
Example #2
0
        public UnityPropertySheet(ObjectReader reader)
        {
            var version = reader.version;

            int m_TexEnvsSize = reader.ReadInt32();

            m_TexEnvs = new KeyValuePair <string, UnityTexEnv> [m_TexEnvsSize];
            for (int i = 0; i < m_TexEnvsSize; i++)
            {
                m_TexEnvs[i] = new KeyValuePair <string, UnityTexEnv>(reader.ReadAlignedString(), new UnityTexEnv(reader));
            }

            if (version[0] >= 2021) //2021.1 and up
            {
                int m_IntsSize = reader.ReadInt32();
                m_Ints = new KeyValuePair <string, int> [m_IntsSize];
                for (int i = 0; i < m_IntsSize; i++)
                {
                    m_Ints[i] = new KeyValuePair <string, int>(reader.ReadAlignedString(), reader.ReadInt32());
                }
            }

            int m_FloatsSize = reader.ReadInt32();

            m_Floats = new KeyValuePair <string, float> [m_FloatsSize];
            for (int i = 0; i < m_FloatsSize; i++)
            {
                m_Floats[i] = new KeyValuePair <string, float>(reader.ReadAlignedString(), reader.ReadSingle());
            }

            int m_ColorsSize = reader.ReadInt32();

            m_Colors = new KeyValuePair <string, Color> [m_ColorsSize];
            for (int i = 0; i < m_ColorsSize; i++)
            {
                m_Colors[i] = new KeyValuePair <string, Color>(reader.ReadAlignedString(), reader.ReadColor4());
            }
        }