mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 16:03:11 +02:00
fixed merge
This commit is contained in:
parent
a0564ec377
commit
530aee0cf8
@ -21,6 +21,8 @@ public class Entity : MonoBehaviour
|
||||
|
||||
[HideInInspector] public UnityEvent<Entity> OnDeath = new UnityEvent<Entity>();
|
||||
|
||||
Vector2Int tileCoord;
|
||||
|
||||
public Team GetOwnTeam()
|
||||
{
|
||||
return myTeam;
|
||||
@ -93,4 +95,8 @@ public class Entity : MonoBehaviour
|
||||
{
|
||||
healthPointsText.text = healthPoints.ToString() + "/" + maxHealthPoints.ToString();
|
||||
}
|
||||
public void SetTileCoords(Vector2Int tileCoordinates)
|
||||
{
|
||||
tileCoord = tileCoordinates;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,14 +10,16 @@ public class SquadManager : MonoBehaviour
|
||||
Squad enemySquad;
|
||||
private void Awake()
|
||||
{
|
||||
playerSquad = Instantiate(squadPrefab).GetComponent<Squad>();
|
||||
playerSquad.gameObject.name = "Player Squad";
|
||||
playerSquad.transform.SetParent(transform);
|
||||
|
||||
|
||||
enemySquad = Instantiate(squadPrefab).GetComponent<Squad>();
|
||||
enemySquad.gameObject.name = "Enemy Squad";
|
||||
enemySquad.transform.SetParent(transform);
|
||||
|
||||
playerSquad = Instantiate(squadPrefab).GetComponent<Squad>();
|
||||
playerSquad.gameObject.name = "Player Squad";
|
||||
playerSquad.transform.SetParent(transform);
|
||||
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
|
||||
@ -105,7 +105,7 @@ public class TilemapManager : MonoBehaviour
|
||||
else
|
||||
tiles[x, y].standingEntity = Instantiate(soldierPrefab, tilemap.CellToWorld(new Vector3Int(x, y, 0)) + WORLD_SPACE_OFFSET, Quaternion.identity).GetComponent<Soldier>();
|
||||
|
||||
if (tiles[x, y].standingSoldier == null)
|
||||
if (tiles[x, y].standingEntity == null)
|
||||
return false;
|
||||
|
||||
if (isAlly)
|
||||
@ -159,7 +159,7 @@ public class TilemapManager : MonoBehaviour
|
||||
|
||||
public static bool MoveSoldierS(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
return ins.MoveSoldier(x1, y1, x2, y2);
|
||||
return ins.MoveEntity(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
// ---------- private methods
|
||||
|
||||
Loading…
Reference in New Issue
Block a user