예제 #1
0
 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;
 }
예제 #2
0
        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);
            }
        }