Ejemplo n.º 1
0
        public static void LoadToObject(Component game, ref CompositeColliderData data, string mat)
        {
            var obj = game as CompositeCollider2D;

            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.geometryType    = data.geometryType;
            obj.generationType  = data.generationType;
            obj.vertexDistance  = data.vertexDistance;
            if (mat != null)
            {
                obj.sharedMaterial = new PhysicsMaterial2D(mat);
            }
        }
Ejemplo n.º 2
0
 public unsafe override void Load(FakeStruct fake)
 {
     data           = *(CompositeColliderData *)fake.ip;
     sharedMaterial = fake.buffer.GetData(data.sharedMaterial) as string;
 }