using System; using System.Collections.Generic; using UnityEngine; [System.Serializable] public class PlayerBaseData { public PlayerTypes playerType; public PlayerBase playerBase; } public class PlayerBaseHandler : MonoBehaviour { [SerializeField] private PlayerBase[] playerBases; public void InitPlayerTypes(List playerTypes) { foreach (PlayerBase playerBase in playerBases) { if (playerTypes.Contains(playerBase.GetPlayerType())) { playerBase.InitPlayerIds(); playerBase.gameObject.SetActive(true); } else { playerBase.gameObject.SetActive(false); } } } public void GetPlayerBase() { } }