Esempio n. 1
0
        private IEnumerator OpenInnerDoorAfterDelay()
        {
            while (_outerDoor.IsClosed == false)
            {
                yield return(null);
            }
            foreach (GameObject obj in _outerObjects)
            {
                obj.SetActive(false);
            }
            yield return(new WaitForSeconds(_countdownToOpenInnerDoor));

            foreach (GameObject obj in _innerObjects)
            {
                obj.SetActive(true);
            }
            _innerDoor.Open();
        }
Esempio n. 2
0
        protected void Update()
        {
            if (_initialized == false)
            {
                if (Dialog.Instance == null)
                {
                    return;
                }
                StartDialog(DialogName.Start);
                _inside.SetActive(false);
                _outerTrigger.OnAutoTrigger += HandleAutoTrigger;
                enabled      = false;
                _initialized = true;
                return;
            }

            if (_outerDoor.IsClosed == false)
            {
                return;
            }
            _outside.SetActive(false);

            _outdoorAir.Stop();

            if (_openedInnerDoor == false)
            {
                _countdownToOpenInnerDoor -= Time.deltaTime;

                if (_countdownToOpenInnerDoor <= 0)
                {
                    _openedInnerDoor = true;
                    _innerDoor.Open();
                    _inside.SetActive(true);
                }
            }
            else
            {
                if (_innerDoor.CurrentState == DoorGadget.State.Opening)
                {
                    _indoorAir.Play();
                    enabled = false;
                }
            }
        }