public void DestroyIt() { BiteSystem biteSystem = FindObjectOfType <BiteSystem>(); biteSystem.OnBiteStartEvent -= OnBiteStart; biteSystem.OnBiteEndEvent -= OnBiteEnd; GameObject.Destroy(this.gameObject); }
void Start() { this.animator = GetComponent <Animator>(); BiteSystem biteSystem = FindObjectOfType <BiteSystem>(); biteSystem.OnBiteStartEvent += OnBiteStart; biteSystem.OnBiteEndEvent += OnBiteEnd; this.bobberAudioSource = GetComponent <AudioSource>(); this.bobberAudioSource.PlayOneShot(this.splashAudioClip); }