Example #1
0
        internal virtual void InitializeParticle(Particle inParticle)
        {
            float movementSpeed = _movementSpeedRange.GetRandom(FrozenCore.FastRandom);
            float rotationSpeed = _rotationSpeedRange.GetRandom(FrozenCore.FastRandom);
            float scaleSpeed    = _scaleSpeedRange.GetRandom(FrozenCore.FastRandom);

            float direction = _initialDirectionRange.GetRandom(FrozenCore.FastRandom);
            float rotation  = _initialRotationRange.GetRandom(FrozenCore.FastRandom);
            float scale     = _initialScaleRange.GetRandom(FrozenCore.FastRandom);

            float ttl = _timeToLiveRange.GetRandom(FrozenCore.FastRandom);

            Vector3 origin = FXArea.GetPoint(FrozenCore.FastRandom);

            inParticle.SetData(_particleMaterial,
                               origin,
                               movementSpeed,
                               rotationSpeed,
                               scaleSpeed,
                               rotation,
                               _emitterDirection + direction,
                               scale,
                               ttl,
                               _colorRange);
        }
Example #2
0
    public override void Play(AudioSource source)
    {
        if (!clip)
        {
            return;
        }

        source.volume = volume.GetRandom();
        source.pitch  = pitch.GetRandom();

        source.PlayOneShot(clip);
    }
Example #3
0
    public override void Play(AudioSource source)
    {
        if (clips.Length == 0)
        {
            return;
        }

        source.clip   = clips[Random.Range(0, clips.Length)];
        source.volume = volume.GetRandom();
        source.pitch  = pitch.GetRandom();

        source.Play();
    }
Example #4
0
    public void Play()
    {
        if (!IsPlaying())
        {
            handle = SoundManager.instance.Play(
                sound,
                SoundFlag.OneShot | SoundFlag.Looping,
                parent == null ? transform : parent
                );

            switch (startTimeMode)
            {
            case TimeMode.RandomRangeNormTime:
                SoundManager.instance.SetNormTime(handle, startTimeRange.GetRandom());
                break;

            case TimeMode.RandomRangeTime:
                SoundManager.instance.SetTime(handle, startTimeRange.GetRandom());
                break;

            default: break;
            }
        }
    }
        void BuildLandscape()
        {
            for (int x = -dimentions.x; x < dimentions.x; x++)
            {
                for (int y = -dimentions.y; y < dimentions.y; y++)
                {
                    // empty space for roads
                    if (x % blockDimentions.x == 0 || y % blockDimentions.y == 0)
                    {
                        continue;
                    }

                    if (UnityEngine.Random.Range((float)0.0f, (float)1.0) < landscapeDensityFactor)
                    {
                        float height       = towerHeight.GetRandom();
                        float heightFactor = towerHeight.InvLerp(height);
                        Color color        = towerColorRangeBasedOnHeight.Lerp(heightFactor);
                        CreateATower(new Vector2Int(x, y), height, color);
                    }
                }
            }
        }
Example #6
0
    protected void Update()
    {
        next -= Time.deltaTime;

        if (next <= 0.0f)
        {
            if (quitNext)
            {
                App.LoadScene("JungleHijinks");
                //Application.Quit();
                return;
            }

            next = interval.GetRandom();

            text.text = texts[index];

            if (++index >= texts.Length)
            {
                quitNext = true;
                index    = 0;
            }
        }
    }