Exemplo n.º 1
0
 public MMIOHandlerAudio(int baseAddress) : base(baseAddress)
 {
     for (int i = 0; i < audioLines.Length; i++)
     {
         audioLines[i] = new AudioLine();
     }
 }
    void Start()
    {
        _fireplace_controller = GameObject.Find("Fireplace").GetComponent <FireplaceController>();

        _sun_controller = GameObject.Find("Sun Light").GetComponent <LightController>();

        _skybox_controller = GetComponent <SkyboxController>();

        _audio_source             = gameObject.AddComponent <AudioSource>();
        _audio_source.loop        = false;
        _audio_source.playOnAwake = false;
        _audio_source.priority    = 256; // top priority

        _audio_source_2             = gameObject.AddComponent <AudioSource>();
        _audio_source_2.loop        = false;
        _audio_source_2.playOnAwake = false;
        _audio_source_2.priority    = 256; // top priority

        _voice_stopped = false;

        if (_clips.Length > 0)
        {
            _audio_lines = new AudioLine[_clips.Length];
            for (int i = 0; i < _clips.Length; i++)
            {
                // _audio_lines[i] = new AudioLine(_clips[i]);
                _audio_lines[i] = new AudioLine
                {
                    _clip    = _clips[i],
                    _seconds = 2.5f,
                    _played  = false,
                };

                if (i == 0)
                {
                    _audio_lines[i]._seconds = 5f;
                }
            }
        }

        _current = 0;

        _is_end = false;

        _sun_controller.StartSunset();

        // StartCoroutine(WaitAndSurvive(10));
    }