Exemple #1
0
    protected IEnumerator AreaAppear(Vector2 position, Side side)
    {
        OnBegin(position, side);
        m_timer = m_cooldown;

        yield return(new WaitForSeconds(instantiateDelay));

        AreaOfEffect aoe = Instantiate(m_prefabEffect, position, Quaternion.identity) as AreaOfEffect;

        aoe.Initialize(side);

        OnInstantiate(aoe);
    }
Exemple #2
0
    public void Infect(bool force = false)
    {
        if (force || !infected)
        {
            infectedSign = Instantiate(InfectedSignPrefab, transform);


            infected = true;
            blastGO.SetActive(true);
            aoeGO     = Instantiate(AreaOfEffectPrefab, transform);
            aoeScript = aoeGO.GetComponent <AreaOfEffect>();
            aoeScript.Initialize(infectRadius, infectDuration);

            if (soundManager)
            {
                soundManager.playInfection();
            }

            if (_gameState != null)
            {
                _gameState.SendMessage("SetLastCharacterInfected", gameObject);
            }
        }
    }