Example #1
0
    private void Update()
    {
        if (_RespawnObjects == null)
        {
            _RespawnObjects = GameObject.FindObjectOfType <RespawnObjects>();
        }

        if (_Timer >= 3f)
        {
            foreach (BreakableWall wall in _Brownies)
            {
                wall.gameObject.SetActive(false);
            }
            DisableCharacter();
            _Timer = 0f;
        }

        CountdownText();

        if (_CurrentDevice == null)
        {
            return;
        }

        if (_CurrentOther.GetComponent <PlayerController>()._CurrentInteractable == this.gameObject &&
            _CurrentOther.GetComponent <PlayerController>().Grab.transform.childCount == 0)
        {
            if (_Picked == false && _CurrentDevice.RightTrigger.WasPressed)
            {
                if (_IsSpiceGirl == true)
                {
                    if (_CurrentOther.GetComponent <PlayerController>()._Player2CurrentState == PlayerController.Player2State.Fire && _CurrentOther.CompareTag("Player2"))
                    {
                        _Picked = true;
                        _Wick.SetActive(true);
                        _Anim.SetTrigger("Activated");
                        _Pickable._RightTriggerImage.gameObject.SetActive(false);
                        _SpiceGirl.gameObject.SetActive(false);
                    }
                }
            }
        }

        if (_Wick.activeInHierarchy == true)
        {
            if (_SoundPlaying == false)
            {
                _AS.PlayOneShot(_BombIsActive, 1f);
                _SoundPlaying = true;
            }
            uiText.gameObject.SetActive(true);
            _Timer += Time.deltaTime;
        }

        if (_Timer >= 3.05f)
        {
            DisableCharacter();
            _Timer = 0f;
        }
    }
Example #2
0
 private void Awake()
 {
     _RopeOrigin     = transform.position;
     _Origin         = _Flame.transform.position;
     _RespawnObjects = GetComponent <RespawnObjects>();
     _AS             = GetComponent <AudioSource>();
 }
Example #3
0
 private void Awake()
 {
     _Origin         = transform.position;
     _RespawnObjects = GetComponent <RespawnObjects>();
     _AS             = GetComponent <AudioSource>();
     _RB             = GetComponent <Rigidbody>();
 }
Example #4
0
 private void OnEnable()
 {
     _RespawnObjects = GameObject.FindObjectOfType <RespawnObjects>();
     _CurrentOther   = null;
     _CurrentDevice  = null;
 }
Example #5
0
 private void Start()
 {
     _RespawnObjects = GameObject.FindObjectOfType <RespawnObjects>();
 }
Example #6
0
 private void OnEnable()
 {
     _RespawnObjects    = GameObject.FindObjectOfType <RespawnObjects>();
     transform.position = _Origin;
 }