public unsafe override void Load(FakeStruct fake) { data = *(SpriteMaskData *)fake.ip; assetsName = fake.buffer.GetData(data.assetName) as string; textureName = fake.buffer.GetData(data.textureName) as string; spriteName = fake.buffer.GetData(data.spriteName) as string; }
public static void LoadToObject(Component game, ref SpriteMaskData data, SpriteMaskModel mod) { var obj = game.GetComponent <SpriteMask>(); if (obj == null) { return; } obj.alphaCutoff = data.alphaCutoff; obj.isCustomRangeActive = data.isCustomRangeActive; obj.frontSortingLayerID = data.frontSortingLayerID; obj.frontSortingOrder = data.frontSortingOrder; obj.backSortingLayerID = data.backSortingLayerID; obj.backSortingOrder = data.backSortingOrder; obj.spriteSortPoint = data.spriteSortPoint; if (mod.textureName != null) { obj.sprite = ElementAsset.FindSprite(mod.assetsName, mod.textureName, mod.spriteName); } }