31 lines
772 B
C#
Raw Normal View History

2026-01-21 20:27:45 +05:30
using UnityEngine;
[System.Serializable]
public class BasePlacementData
{
public int playerBaseId;
public Transform placementTransform;
}
2026-01-21 20:27:45 +05:30
public class PlayerBase : MonoBehaviour
{
[SerializeField] private PlayerTypes playerType;
[SerializeField] private BasePlacementData[] basePlacementDatas;
[SerializeField] private PlayerPawn[] playerPawns;
public PlayerTypes GetPlayerType() => playerType;
2026-01-26 13:03:50 +05:30
public void InitPlayerData()
2026-01-21 20:27:45 +05:30
{
for (int idx = 0; idx < basePlacementDatas.Length; idx++)
{
2026-01-26 13:03:50 +05:30
playerPawns[idx].Init(basePlacementDatas[idx].playerBaseId, playerType);
}
2026-01-21 20:27:45 +05:30
}
2026-01-26 13:03:50 +05:30
public Transform GetBasePlacementDataPosition(int idx)
2026-01-21 20:27:45 +05:30
{
2026-01-26 13:03:50 +05:30
return basePlacementDatas[idx].placementTransform;
2026-01-21 20:27:45 +05:30
}
}