public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            foreach (var entry in Scope.GetEntries(payload.Data))
            {
                var textureSize = TextureSize.GetValue(entry);

                var newTexture = new Texture2D(textureSize, textureSize);

                var primaryColor = PrimaryColor.GetValue(entry);

                var newPixels = Enumerable.Repeat(primaryColor, textureSize * textureSize).ToArray();

                newTexture.SetPixels(newPixels);

                newTexture.Apply();

                TextureTarget.SetValue(newTexture, entry);
            }

            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
Ejemplo n.º 2
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            foreach (var entry in Scope.GetEntries(payload.Data))
            {
                var noiseTexture = ConstructNoiseTexture.GenerateNoiseTexture(
                    TextureSize.GetValue(entry),
                    LowerOctave.GetValue(entry),
                    UpperOctave.GetValue(entry),
                    Persistence.GetValue(entry),
                    BandingGradient.GetValue(entry),
                    BitDepth.GetValue(entry),
                    1f);

                TextureTarget.SetValue(noiseTexture, entry);
            }

            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }