public void OnDropped(GameObject Dropped, GameObject Zone) { if (Dropped == null) { throw new Exception("UIController -> The object just dropped is null."); } if (Zone == null) { throw new Exception("UIController -> The Zone you dropped on is null."); } MonoBehaviour[] Components = Dropped.GetComponents <MonoBehaviour>(); for (int i = 0; i < Components.Length; i++) { MonoBehaviour CurrentComponent = Components[i]; if ((CurrentComponent as ICard) != null) { ICard CurrentCard = (CurrentComponent as ICard); CurrentCard.DroppedOn(Zone.GetComponent <DropZone>()); } } }