コード例 #1
0
 public void Ready(Vector3 where)
 {
     transform.position = where;
     expend.SetActive(false);
     bullet.SetActive(true);
     another.Close();
 }
コード例 #2
0
    void Update()
    {
        _health = Mathf.Clamp(_health, 0, 1000);
        if (Input.GetButtonDown("Fire2"))
        {
            _audioController.Play();
            Instantiate(bullet, muzzle.transform.position, muzzle.transform.rotation);
        }
        if (_health <= 0)
        {
            AudioSource cameraSource = GameObject.Find("Main Camera").GetComponent <AudioSource>();
            cameraSource.Stop();
            cameraSource.clip = _gameOverClip;
            cameraSource.Play();

            Destroy(gameObject);
        }

        if (Input.GetKeyDown("e"))
        {
            if (_doorInstance != null)
            {
                if (_doorInstance._isSolved)
                {
                    if (_doorInstance.IsOpen)
                    {
                        _doorInstance.Close();
                    }
                    else
                    {
                        _doorInstance.Open();
                    }
                }
                else
                {
                    _pauseController.ShowPasscodeScreen(_doorInstance);
                }
            }
        }
    }
コード例 #3
0
    void OnTriggerExit(Collider other)
    {
        DoorControl dc = door.GetComponent <DoorControl>();

        dc.Close();
    }