Пример #1
0
    public void Trigger(SubtitleController TextDisplay)
    {
        foreach (ExplosiveDamage explosion in explosions)
        {
            if (explosion != null)
            {
                explosion.explode(TextDisplay);
            }
            try {
                if (explosion.GetComponent <Detonator>() != null)
                {
                    explosion.GetComponent <Detonator>().Explode();
                }
            } catch (SystemException e) {
                Debug.LogError("Explosion Failed. DAMNIT IT!");
                Debug.LogError(e.ToString());
            }
        }


        if (QTSEController != null)
        {
            QTSEController.Queue(Spam);
        }
        if (sound != null && soundSource != null)
        {
            soundSource.PlayOneShot(sound);
        }
        if (showText)
        {
            TextDisplay.setLines(Text);
        }
        if (instantiableObject != null)
        {
            for (int i = 0; i < number; i++)
            {
                MonoBehaviour.Instantiate(instantiableObject, (UnityEngine.Random.value * tolerance) + place, new Quaternion(0, 0, 0, 1));
            }
        }

        if (radioWriteStyle == editSettings.append)
        {
            foreach (AudioClip clip in RadioSounds)
            {
                radio.clips.Add(clip);
            }
        }
        if (radioWriteStyle == editSettings.overwrite)
        {
            radio.clips = RadioSounds;
        }
        foreach (DoorControl d in doors)
        {
            d.d.setState(d.open);
        }
        foreach (ObjectManipulation OM in OMs)
        {
            OM.use();
        }
        foreach (UniqueEffect ue in UE)
        {
            ue.trigger();
        }
        foreach (TriggerableEvent TEvent in events)
        {
            TEvent.Trigger(TextDisplay);
        }
    }