Esempio n. 1
0
        private void GameOver(WorldEntityController killingEntity)
        {
            foreach (var soundWaveController in _soundWaveControllers)
            {
                if (soundWaveController != null && soundWaveController.GetOriginEntity() != killingEntity)
                {
                    soundWaveController.GetRigidbody().velocity = Vector2.zero;
                }
            }

            mainUiController.StartTransition(Color.red);
        }
Esempio n. 2
0
        private void Burst(WorldEntityController entity, Vector3 position, Gradient gradient, bool fadeTrails, int burstSeparationAngle, int bursOffsetAngle, float burstOffsetVector,
                           float forceStrenght, float maxTimeAlive)
        {
            for (int angle = 0; angle < 360; angle += burstSeparationAngle)
            {
                float   angleInRad = (float)(angle + bursOffsetAngle) * Mathf.Deg2Rad;
                Vector2 dir        = new Vector2((float)Math.Cos(angleInRad), (float)Math.Sin(angleInRad));

                SoundWaveController soundWaveController =
                    Instantiate(soundWaveControllerPrefab,
                                position + new Vector3(dir.x, dir.y, 0) * burstOffsetVector, Quaternion.identity,
                                soundWaveParent.transform);
                soundWaveController.Init(entity, maxTimeAlive, gradient, fadeTrails, dir, forceStrenght);
                soundWaveController.onDestroy += CleanSoundWave;
                _soundWaveControllers.Add(soundWaveController);
            }
        }