Tanoda
pb_MeshCollider.cs
Go to the documentation of this file.
1using UnityEngine;
2using System.Collections;
3using System.Collections.Generic;
4using System.Runtime.Serialization;
5using GILES;
6
8{
12 public class pb_MeshCollider : pb_SerializableObject<UnityEngine.MeshCollider>
13 {
14 public pb_MeshCollider(UnityEngine.MeshCollider obj) : base(obj) {}
15 public pb_MeshCollider(SerializationInfo info, StreamingContext context) : base(info, context) {}
16
17 public override Dictionary<string, object> PopulateSerializableDictionary()
18 {
19 Dictionary<string, object> props = pb_Reflection.ReflectProperties(target);
20
21 object m;
22
25 if(props.TryGetValue("sharedMesh", out m))
26 {
27 MeshFilter mf = target.gameObject.GetComponent<MeshFilter>();
28
29 if(mf != null && mf.sharedMesh.GetInstanceID() == m.GetHashCode())
30 props.Remove("sharedMesh");
31 }
32
33 return props;
34 }
35 }
36}
pb_MeshCollider(SerializationInfo info, StreamingContext context)
pb_MeshCollider(UnityEngine.MeshCollider obj)
override Dictionary< string, object > PopulateSerializableDictionary()
T target
A reference to the component being serialized. Will be null on deserialization.