Example #1
0
    public void AddDude()
    {
        if (hasReserve)
        {
            ActivateIfNeeded();
            return;
        }

        reserveDude          = Instantiate(dudePrefab, transform.position, Quaternion.identity);
        reserveDude.launcher = this;
        reserveDude.jumper   = jumpers;
        reserveDude.canDie   = false;
        reserveDude.AddHardHat(immortals);
        reserveDude.NudgeHands();
        reserveDude.line.enabled = false;
        hasReserve = true;

        if (intro)
        {
            reserveDude.goalHomer.isIntro = true;
        }

        EffectManager.Instance.AddEffect(5, reserveDude.body.transform.position);
        EffectManager.Instance.AddEffect(7, reserveDude.body.transform.position);

        AudioManager.Instance.PlayEffectAt(Random.Range(70, 78), reserveDude.body.transform.position, 0.5f);
        AudioManager.Instance.PlayEffectAt(Random.Range(50, 63), reserveDude.body.transform.position, 0.5f);

        reserveDude.gameObject.name = "Dude #" + launchCount;

        dudes.Add(reserveDude);
        GarbageCollection();

        ActivateIfNeeded();
    }