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