private void Awake() { if (usesCamEvent && headButtActivation && eventTrigger == null) { eventTrigger = GetComponent <Event_Trigger>(); if (eventTrigger == null) { Debug.LogWarning("This object is marked as using a Cam Event! Either mark 'usesCamEvent' as false or attach an Event_Trigger script to this object!"); } } objPrefs = GetComponent <ObjectPreferences>(); audioSource = GetComponent <AudioSource>(); }
// Start is called before the first frame update void Start() { objPref = GetComponent <ObjectPreferences>(); acornAudio = GetComponent <AudioSource>(); //if (pickUpType == PickUpType.MULCH) //{ // mulchCollider = GetComponent<Collider>(); // StartCoroutine(KillCollider()); //} if (pickUpType == PickUpType.ACORN) { if (objPref != null && acornAudio != null) { acornAudio.clip = objPref.pickup_AudioClip; } } GameController.Instance.onLevelLoaded += UpdateOnLevelLoad; }