public static KeepObjectBetweenScenes GetInList(KeepObjectBetweenScenes current) { foreach (var item in listDontDestroyObjects) { if (item.gameObject.CompareTag(current.gameObject.tag) && item.gameObject.name == current.gameObject.name) { return(item); } } return(null); }
public static void SetInList(KeepObjectBetweenScenes current) { listDontDestroyObjects.Add(current); }