public override void OnManagerAdd() { BreathMeter = Controller.GetComponent <BreathMeter>(); if (!BreathMeter) { Debug.LogWarning("Tried to give air, but the controller has no breath meter!"); return; } BreathMeter.HasExtraAirSource = true; }
// Use this for initialization void Start () { this.insideWall = true; this._pc = GetComponent<PlayerController>(); this._cc = GetComponent<CharacterController>(); this._blood = Resources.Load<GameObject>("Prefabs/Blood"); this._health = this.GetComponent<PlayerHealth>(); this._playerAudio = GetComponent<PlayerAudio>(); this._blindEffect = GameObject.Find("BlindOverlay").GetComponent<Image>(); this._breathMeter = GameObject.Find("BreathMeter").GetComponent<BreathMeter>(); this._trail = Resources.Load<GameObject>("Prefabs/MagicTrail"); }