Inheritance: UnityEngine.MonoBehaviour
        // Use this for initialization
        void Start()
        {
            _mouseController = GameObject.FindGameObjectWithTag ("UiReticle").GetComponent<Mouse_Controller> ();
            _gunController = gameObject.GetComponentInChildren<SpiritGun> ();
            _soundManager = GameObject.Find ("SoundManager").GetComponent<SoundManager> ();

            flashlightSound.clip = _soundManager.GetSFXSound(3);

            if (StartingState == State.GUN && _currentState != State.GUN)
            {
                _currentState = State.GUN;
                _mouseController.setEquipped(false);
                _gunController.setEquipped(true);
            }
            else if (StartingState == State.HAND && _currentState != State.HAND)
            {
                _currentState = State.HAND;
                _mouseController.setEquipped(true);
                _gunController.setEquipped(false);
            }

            //Get flashlight
            //_flashlight = GetComponentInChildren<Light>();

            if (FlashlightOn)
            {
                _flashlight.enabled = true;
                _GrabbablesLight.enabled = true;
            }
            else
            {
                _flashlight.enabled = false;
                _GrabbablesLight.enabled = false;
            }
        }
Esempio n. 2
0
        // Use this for initialization
        void Start()
        {
            _checkpointData.SpawnLocation = GetComponentInChildren<Transform>().position;
            _player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerStats>();
            _spiritGun = GameObject.Find("Gun").GetComponent<SpiritGun>();

            _checkpointData.SpawnLocation = transform.GetChild(0).transform.position;

            EventManager.AddListener((int) GameManagerScript.GameEvents.LoadlastCheckpoint, OnLoadLastCheckpoint);
        }
 // Use this for initialization
 void Start()
 {
     _spiritGun = GameObject.Find("Gun").GetComponent<GunController.SpiritGun>();
     _soundManager = GameObject.Find ("SoundManager").GetComponent<SoundManager> ();
     collectSound = _soundManager.GetSFXSound(2);
 }