Ejemplo n.º 1
0
        public static void LoadToObject(Component game, ref PolygonColliderData data, PolygonColliderModel edge)
        {
            var obj = game.GetComponent <PolygonCollider2D>();

            if (obj == null)
            {
                return;
            }
            if (edge.sharedMaterial != null)
            {
                obj.sharedMaterial = new PhysicsMaterial2D(edge.sharedMaterial);
            }
            obj.points         = edge.points;
            obj.offset         = data.offset;
            obj.usedByEffector = data.usedByEffector;
            obj.isTrigger      = data.isTrigger;
            obj.density        = data.density;
            obj.autoTiling     = data.autoTiling;
            obj.pathCount      = data.pathCount;
        }
Ejemplo n.º 2
0
 public unsafe override void Load(FakeStruct fake)
 {
     data           = *(PolygonColliderData *)fake.ip;
     sharedMaterial = fake.buffer.GetData(data.sharedMaterial) as string;
     points         = fake.buffer.GetArray <Vector2>(data.points);
 }