private bool ShouldRefresh() { bool areSameGameObjs = Extentions.AreArraysEqual(effectsObjs, usableEffectsObjs); if (areSameGameObjs) { bool matchStoredFXToUsableObjs = storedEffectsPerObj.Length == usableEffectsObjs.Length; if (matchStoredFXToUsableObjs == false) { return(true); } for (int i = 0; i < usableEffectsObjs.Length; i++) { bool areSameEffects = true; GameObject effectsObj = usableEffectsObjs[i]; if (effectsObj != null) { List <MonoBehaviour> currEnabledEffectsL = effectsObj.GetComponents <MonoBehaviour>().ToList(); currEnabledEffectsL.RemoveAll((effect) => effect.enabled == false); MonoBehaviour[] currEnabledEffects = currEnabledEffectsL.ToArray(); MonoBehaviour[] storedEffects = storedEffectsPerObj[i]; areSameEffects = Extentions.AreArraysEqual(storedEffects, currEnabledEffects); } if (areSameEffects) { continue; } return(true); } } else { return(true); } return(false); }