private void OnMouseDown() { if (!hasBeenClickedOnce) { hasBeenClickedOnce = true; } if (!myClipPlayer.myAudioSource.isPlaying) { Debug.Log("I'm triggering BeginClip"); myClipPlayer.BeginClip(); fadeAudioSprite(); } if (hasBeenClickedOnce) { if (cutoffValue <= 1.1) { if (clickNumberTracker == 2) { clickText.DOFade(0f, 1f); } myMeshRenderer.material.SetFloat("_Cutoff", cutoffValue); cutoffValue = cutoffValue + .1f; clickNumberTracker++; } } }
private void OnMouseDown() { clickedObject = true; audioSprite.material = HallwayManager.instance.materialArray[0]; if (audioSprite.color.a >= .3f) { Debug.Log("I'm triggering BeginClip"); myClipPlayer.BeginClip(); audioSprite.DOFade(0f, .5f).OnComplete(() => gameObject.SetActive(false)); } }