private void AddExpectedKeysForType <TComponentType>() where TComponentType : MonoBehaviour { var components = FindObjectsOfType <TComponentType>(); foreach (var component in components) { var newlyFoundKeys = ReflectionFunctions.GetAttributeValuesOnTarget <EventOfInterestRegistrationAttribute, DialogueData> ( component ).ToList(); var newExpectedKeys = new List <string>(); foreach (var newlyFoundKey in newlyFoundKeys) { foreach (var dialogueEntry in newlyFoundKey.DialogueEntries) { newExpectedKeys.Add("Key: " + dialogueEntry.DialogueEntryKey + "\tObject Name: " + component.gameObject.name); } } _expectedKeys.AddRange(newExpectedKeys); } }
private void AddKeysForType <TComponentType>() where TComponentType : MonoBehaviour { var components = FindObjectsOfType <TComponentType>(); foreach (var component in components) { var newlyFoundKeys = ReflectionFunctions.GetAttributeValuesOnTarget <EventOfInterestKeyAttribute, string> ( component ).ToList(); for (var i = 0; i < newlyFoundKeys.Count(); i++) { newlyFoundKeys[i] = "Key: " + newlyFoundKeys[i] + "\tObject Name: " + component.gameObject.name; } _foundKeys.AddRange(newlyFoundKeys); } }