public bool CheckIfMatch(Character character){ bool match = false; List<Transform> list = character.characterData.GetAllContolledParts (); AudioSource targetSourceClip = null; int matches = 0; for (int j = 0; j < list.Count; j++) { if(list[j].GetComponent<Animation>().isPlaying){ if(IsAPartNeedMoving(character,list[j])){ matches ++; }else{ matches = 0; break; } } } if (matches == allPartsNeedMoving.Count) { match = true; } if (match && wantedSoundIndex != 0) { targetSourceClip = character.GetComponent<AudioSource> (); if(targetSourceClip.clip == null || ((character.GetIndexOfAudio(targetSourceClip.clip) + 1) != wantedSoundIndex || (character.GetIndexOfAudio(targetSourceClip.clip) + 1) == wantedSoundIndex && !targetSourceClip.isPlaying)){ // BECAUSE 0 == DEFAULT == NO SOUND match = false; } } return match; }