Ejemplo n.º 1
0
    public void SnowDrop(SnowBonus.FreezeData freezeData, bool isVisible)
    {
        if (isVisible)
        {
            for (int deg = 0; deg < 360; deg += 20)
            {
                float radians = deg * Mathf.Deg2Rad;
                float xPos    = freezeData.StartPoint.x + freezeData.Distance * Mathf.Cos(radians);
                float yPos    = freezeData.StartPoint.y + freezeData.Distance * Mathf.Sin(radians);

                Vector3 dropPosition = new Vector3(xPos, yPos, 0);
                NormalizePosition(ref dropPosition, false);
                GameObject drop = Instantiate(_snowDropGameObject);
                drop.transform.position = new Vector3(xPos, yPos, 0);
                _spawnedDrops.Add(drop);
            }
        }
        else
        {
            for (int i = 0; i < _spawnedDrops.Count; i++)
            {
                Destroy(_spawnedDrops[i]);
            }
            _spawnedDrops.Clear();
        }
    }
Ejemplo n.º 2
0
 public void ActivateFreezeBonus(SnowBonus.FreezeData data)
 {
     _isFreezeBonusActive = true;
     _freezeData = data;
 }
Ejemplo n.º 3
0
 public void ActivateFreezeBonus(SnowBonus.FreezeData data)
 {
     _isFreezeBonusActive = true;
     _freezeData          = data;
 }