31 lines
742 B
C#
31 lines
742 B
C#
using UnityEngine;
|
|
|
|
[System.Serializable]
|
|
public class BasePlacementData
|
|
{
|
|
public int playerBaseId;
|
|
public Transform placementTransform;
|
|
}
|
|
|
|
public class PlayerBase : MonoBehaviour
|
|
{
|
|
[SerializeField] private PlayerTypes playerType;
|
|
[SerializeField] private BasePlacementData[] basePlacementDatas;
|
|
[SerializeField] private PlayerPawn[] playerPawns;
|
|
|
|
public PlayerTypes GetPlayerType() => playerType;
|
|
|
|
public void InitPlayerIds()
|
|
{
|
|
for (int idx = 0; idx < basePlacementDatas.Length; idx++)
|
|
{
|
|
playerPawns[idx].InitId(basePlacementDatas[idx].playerBaseId);
|
|
}
|
|
}
|
|
|
|
public BasePlacementData GetBasePlacementData(int idx)
|
|
{
|
|
return basePlacementDatas[idx];
|
|
}
|
|
}
|