public void ApplyStim(GameObject other, Stimulant stim) { StimResponseObject SRObj = other.gameObject.GetComponent <StimResponseObject>(); if (SRObj != null) // Does the other gameobject potentially possess stims? { if (GlobalStims.ContainsKey(stim)) { GlobalStims[stim](); } } }
public void ApplyStims(GameObject other) { StimResponseObject SRObj = other.gameObject.GetComponent <StimResponseObject>(); if (SRObj != null) // Does the other gameobject potentially possess stims? { foreach (Stimulant stim in SRObj.Stims) { // Execute relevant function if (GlobalStims.ContainsKey(stim)) { GlobalStims[stim](); } } } }