void SetBools(Animator animator, StringBoolDictionary animationStatus) { foreach (KeyValuePair <string, bool> entry in animationStatus) { animator.SetBool(entry.Key, entry.Value); } }
protected virtual void OnEnable() { var type = typeof(T); var members = type.GetFields(Flags); if (Fields != null && Fields.Count == members.Length) { return; } Fields = new StringBoolDictionary(); var fieldNames = members.Select(x => x.Name).ToList(); foreach (var fieldName in fieldNames) { Fields.Add(fieldName, false); } }