示例#1
0
        public static void LoadToObject(Component game, ref CapsuleColliderData data, string mat)
        {
            var obj = game as CapsuleCollider2D;

            if (obj == null)
            {
                return;
            }
            obj.offset          = data.offset;
            obj.usedByComposite = data.usedByComposite;
            obj.usedByEffector  = data.usedByEffector;
            obj.isTrigger       = data.isTrigger;
            obj.density         = data.density;
            obj.size            = data.size;
            obj.direction       = data.direction;
            if (mat != null)
            {
                obj.sharedMaterial = new PhysicsMaterial2D(mat);
            }
        }
示例#2
0
 public unsafe override void Load(FakeStruct fake)
 {
     data           = *(CapsuleColliderData *)fake.ip;
     sharedMaterial = fake.buffer.GetData(data.sharedMaterial) as string;
 }