Пример #1
0
 private void GoUp()
 {
     target.DOScale(highest + startScale, dur.GetValue()).SetEase(ease).OnStepComplete(() =>
     {
         isRising = false;
         GoDown();
     });
 }
Пример #2
0
 public void Init(EnemySpawner organizerSpawner)
 {
     this.organizerSpawner     = organizerSpawner;
     currentTimeBetweenEnemies = timeBetweenEnemies.GetValue();
     for (int i = 0; i < points.Count; i++)
     {
         unVisitedPoints.Add(i);
         if (waveType == WaveType.Enabler)
         {
             GameObject point = points[i];
             point.SetActive(false);
         }
     }
 }
Пример #3
0
        private void InitializeWaves()
        {
            for (int i = currentWave; i < waves.Length; i++)
            {
                Wave w = waves[i];
                w.Init(spawner);
            }

            currentTimeBetweenWaves = timeBetweenWaves.GetValue();
            if (runOnStart)
            {
                ActivateOrganizer(autoAdvance);
            }
        }
        private void Arrange()
        {
            if (lastRndHeigth.Equals(rndHeigth))
            {
                return;
            }

            if (arrangeChildren)
            {
                SetArrangablesAsChildren();
            }

            if (arrangeables.Length == 0)
            {
                return;
            }

            for (int i = 0; i < arrangeables.Length; i++)
            {
                Transform a   = arrangeables[i];
                float     y   = rndHeigth.GetValue();
                Vector3   pos = a.localPosition;
                pos.y           = y;
                a.localPosition = pos;
            }
            lastRndHeigth = new MinMaxRange(rndHeigth);
        }
Пример #5
0
 private void Start()
 {
     if (displaceOnStart)
     {
         Displace(displacementLength.GetValue());
     }
 }
Пример #6
0
        private void UpdateData()
        {
            xRot = xRotPerMin.GetValue();
            yRot = yRotPerMin.GetValue();
            zRot = zRotPerMin.GetValue();

            deltaTime = Time.deltaTime;
            xPerFrame = MathExtensions.RotPerMinuteToRotPerFrame(xRot, deltaTime);
            yPerFrame = MathExtensions.RotPerMinuteToRotPerFrame(yRot, deltaTime);
            zPerFrame = MathExtensions.RotPerMinuteToRotPerFrame(zRot, deltaTime);
        }
Пример #7
0
        public override IEnumerator Behavior()
        {
            if (isPlaying)
            {
                yield break;
            }
            isPlaying  = true;
            startScale = target.localScale;
            float time = 0;

            foreach (Vector3 scale in scalesSequence)
            {
                Vector3 totalScale = scale + startScale;
                time = dur.GetValue();
                target.DOScale(totalScale, time).SetEase(ease);
                yield return(new WaitForSeconds(time));
            }
            time = dur.GetValue();
            target.DOScale(startScale, time).SetEase(ease);
            yield return(new WaitForSeconds(time));

            isPlaying = false;
        }
Пример #8
0
        private void Awake()
        {
            duration = rDuration.GetValue();
            Keyframe[] keys = intensityOverLifeTime.keys;
            float      curveMultiplayerVal = curveMultiplayer.GetValue();

            for (int i = 0; i < keys.Length; i++)
            {
                Keyframe key = keys[i];
                key.value = key.value * curveMultiplayerVal;
                keys[i]   = key;
            }
            intensityOverLifeTime = new AnimationCurve(keys);
            RefreshMaterials();
        }
Пример #9
0
        private IEnumerator Flick()
        {
            int maxFlicksCount = Mathf.RoundToInt(this.flicksCount.GetValue());
            int flickscounter  = 0;

            isFlicking = true;
            while (isFlicking)
            {
                float time = timeBetweenFlicks.GetValue();
                yield return(new WaitForSeconds(time));

                onFlick?.Invoke();
                g.SetActive(!g.activeSelf);
                flickscounter = flickscounter + 1;
                isFlicking    = flickscounter < maxFlicksCount;
            }
        }
Пример #10
0
 void Start()
 {
     currTime = timeBetweenTests.GetValue();
 }