Ejemplo n.º 1
0
        private void Update()
        {
            var vPercent = 0.5f;// Mathf.Clamp01(0.2f + (rigidbody.velocity.magnitude / maxVeloxity));

            if (!gliding && (random.Get() < 0.001f))
            {
                gliding = true;
                inGlide = false;
                StartCoroutine(StopGliding(2 + (random.Get() * 5)));
            }

            if (gliding)
            {
                Glide(vPercent);
            }
            else
            {
                Flap(vPercent);
            }

            MoveEyes();
        }
Ejemplo n.º 2
0
        private Dictionary <int, int> GetDistribution(RandomGeneratorInterface generator)
        {
            var buckets = new Dictionary <int, int>();

            for (var i = 0; i < graphIterations; i++)
            {
                var bucket = Mathf.FloorToInt(generator.Get() / graphPrecision);

                if (!buckets.ContainsKey(bucket))
                {
                    buckets[bucket] = 0;
                }

                buckets[bucket]++;
            }

            return(buckets);
        }