// Use this for initialization void Start() { pc = FindObjectOfType <PlayerController>(); meter = FindObjectOfType <AlertMeter>(); lm = FindObjectOfType <LevelManager>(); door_anim = GetComponentInChildren <Animator>(); sprite = GetComponentInChildren <SpriteRenderer>(); }
private void Awake() { if (_instance == null) { _instance = this; } else { Destroy(gameObject); Debug.LogError("more than one AlertMeter detected, don't ignore this error"); } }