コード例 #1
0
        public static NoiseStackSettings Deserialize(ZPackage pkg)
        {
            var stack           = new NoiseStackSettings();
            int noiseLayerCount = pkg.ReadInt();

            for (int i = 0; i < noiseLayerCount; i++)
            {
                stack.NoiseLayers.Add(NoiseLayer.Deserialize(pkg));
            }
            return(stack);
        }
コード例 #2
0
            public static NoiseLayer Deserialize(ZPackage pkg)
            {
                // ReSharper disable once UseObjectOrCollectionInitializer
                var noiseLayer = new NoiseLayer();

                noiseLayer.noiseSettings = NoiseSettings.Deserialize(pkg);
                if (pkg.ReadBool())
                {
                    noiseLayer.noiseWarpSettings = NoiseSettings.Deserialize(pkg);
                }
                if (pkg.ReadBool())
                {
                    noiseLayer.maskSettings = NoiseSettings.Deserialize(pkg);
                }
                if (pkg.ReadBool())
                {
                    noiseLayer.maskWarpSettings = NoiseSettings.Deserialize(pkg);
                }
                return(noiseLayer);
            }