37 lines
797 B
C#
37 lines
797 B
C#
|
|
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> 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()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|