예제 #1
0
        public override void Deserialize(SerializeProperty rootProperty)
        {
            m_FileID = (int)rootProperty.FindChild("m_FileID").Value;
            var pathID = rootProperty.FindChild("m_PathID");
            if (pathID.propertyType == SerializePropertyType.Int) {
                m_PathID = (ulong)((int)pathID.Value);
            } else if(pathID.propertyType == SerializePropertyType.ULong) {
                m_PathID =(ulong)pathID.Value;
            }

        }
예제 #2
0
        public override void Deserialize(SerializeProperty rootProperty)
        {
            m_FileID = (int)rootProperty.FindChild("m_FileID").Value;
            var pathID = rootProperty.FindChild("m_PathID");

            if (pathID.propertyType == SerializePropertyType.Int)
            {
                m_PathID = (ulong)((int)pathID.Value);
            }
            else if (pathID.propertyType == SerializePropertyType.ULong)
            {
                m_PathID = (ulong)pathID.Value;
            }
        }
예제 #3
0
 public override void Deserialize(SerializeProperty rootProperty)
 {
     base.Deserialize(rootProperty);
     bindField("m_Width", rootProperty);
     bindField("m_Height", rootProperty);
     bindField("m_CompleteImageSize", rootProperty);
     bindField("m_TextureFormat", rootProperty);
     bindField("m_MipCount", rootProperty);
     bindField("m_IsReadable", rootProperty);
     bindField("m_ReadAllowed", rootProperty);
     bindField("m_ImageCount", rootProperty);
     bindField("m_TextureDimension", rootProperty);
     m_TextureSettings.Deserialize(rootProperty.FindChild("m_TextureSettings"));
     bindField("m_LightmapFormat", rootProperty);
     bindField("m_ColorSpace", rootProperty);
     image_data = (byte[])rootProperty.FindChild("image data").Value;
 }
예제 #4
0
 protected void bindField(string fieldName, SerializeProperty rootProperty)
 {
     var field = GetType().GetField(fieldName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic
         | System.Reflection.BindingFlags.Instance);
     if (field == null) {
         Debug.LogError("Can't find field {0} in {1}.", fieldName, GetType().Name);
         return;
     }
     var property = rootProperty.FindChild(fieldName);
     if (property == null) {
         Debug.LogError("Can't find property {0} in {1}.", fieldName, GetType().Name);
         return;
     }
     field.SetValue(this, property.Value);
 }
예제 #5
0
 public override void Deserialize(SerializeProperty rootProperty)
 {
     var array = (SerializeProperty[])rootProperty.FindChild("m_Container.Array").Value;
     foreach (var data in array) {
         string path = (string)data.FindChild("path").Value;
         var assetProperty = data.FindChild("asset");
         var asset = new PptrObject();
         asset.Deserialize(assetProperty);
         List<PptrObject> list = null;
         if (!m_Container.TryGetValue(path, out list)) {
             list = new List<PptrObject>();
             m_Container[path] = list;
         }
         list.Add(asset);
     }
 }
예제 #6
0
        public override void Deserialize(SerializeProperty rootProperty)
        {
            var array = (SerializeProperty[])rootProperty.FindChild("m_Container.Array").Value;

            foreach (var data in array)
            {
                string path          = (string)data.FindChild("path").Value;
                var    assetProperty = data.FindChild("asset");
                var    asset         = new PptrObject();
                asset.Deserialize(assetProperty);
                List <PptrObject> list = null;
                if (!m_Container.TryGetValue(path, out list))
                {
                    list = new List <PptrObject>();
                    m_Container[path] = list;
                }
                list.Add(asset);
            }
        }
예제 #7
0
        protected void bindField(string fieldName, SerializeProperty rootProperty)
        {
            var field = GetType().GetField(fieldName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic
                                           | System.Reflection.BindingFlags.Instance);

            if (field == null)
            {
                Debug.LogError("Can't find field {0} in {1}.", fieldName, GetType().Name);
                return;
            }
            var property = rootProperty.FindChild(fieldName);

            if (property == null)
            {
                Debug.LogError("Can't find property {0} in {1}.", fieldName, GetType().Name);
                return;
            }
            field.SetValue(this, property.Value);
        }
예제 #8
0
 public override void Deserialize(SerializeProperty rootProperty)
 {
     base.Deserialize(rootProperty);
     m_FontData = (byte[])rootProperty.FindChild("m_FontData.Array").Value;
 }
예제 #9
0
 public override void Deserialize(SerializeProperty rootProperty)
 {
     base.Deserialize(rootProperty);
     m_Script = (string)rootProperty.FindChild("m_Script").Value;
     m_PathName = (string)rootProperty.FindChild("m_PathName").Value;
 }
예제 #10
0
 public override void Deserialize(SerializeProperty rootProperty)
 {
     m_Name = (string)rootProperty.FindChild("m_Name").Value;
    
 }
예제 #11
0
 public override void Deserialize(SerializeProperty rootProperty)
 {
     base.Deserialize(rootProperty);
     m_FontData = (byte[])rootProperty.FindChild("m_FontData.Array").Value;
 }
예제 #12
0
 public override void Deserialize(SerializeProperty rootProperty)
 {
     base.Deserialize(rootProperty);
     m_Script   = (string)rootProperty.FindChild("m_Script").Value;
     m_PathName = (string)rootProperty.FindChild("m_PathName").Value;
 }
예제 #13
0
 public override void Deserialize(SerializeProperty rootProperty)
 {
     m_Name = (string)rootProperty.FindChild("m_Name").Value;
 }