public static Condition GetCondition(Condition.ConditionName conditionName) { //for (int i = 0; i < Instance.conditions.Length; i++) //{ // if (Instance.conditions[i].description == conditionName) // return Instance.conditions[i]; //} //也可以寫成面那一行 return(Array.Find(Instance.conditions, x => x.description == conditionName)); }
public static Condition GetCondition(Condition.ConditionName conditionName) { return(Array.Find(Instance.conditions, data => data.description == conditionName)); }