mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 16:43:12 +02:00
chore
This commit is contained in:
parent
eb98f2b09f
commit
c5bde051c5
@ -4,8 +4,14 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class Soldier : MonoBehaviour
|
public class Soldier : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
private enum SoldierType
|
||||||
|
{
|
||||||
|
Ally,
|
||||||
|
Enemy
|
||||||
|
}
|
||||||
[SerializeField] private Transform target;
|
[SerializeField] private Transform target;
|
||||||
[SerializeField] private string enemyTag;
|
[SerializeField] private SoldierType enemyType;
|
||||||
|
[SerializeField] private SoldierType ourType;
|
||||||
[SerializeField] private float healthPoints = 1;
|
[SerializeField] private float healthPoints = 1;
|
||||||
[SerializeField] private float rangeAttack = 1;
|
[SerializeField] private float rangeAttack = 1;
|
||||||
[SerializeField] private float rangeView = 1;
|
[SerializeField] private float rangeView = 1;
|
||||||
@ -18,13 +24,13 @@ public class Soldier : MonoBehaviour
|
|||||||
|
|
||||||
public void setOwnTag(string tag)
|
public void setOwnTag(string tag)
|
||||||
{
|
{
|
||||||
gameObject.tag = tag;
|
ourType = tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnemyTag()
|
public void setEnemyTag()
|
||||||
{
|
{
|
||||||
if(gameObject.tag == "Ally") enemyTag = "Enemy";
|
if(ourType == "Ally") enemyType = "Enemy";
|
||||||
else enemyTag = "Ally";
|
else enemyType = "Ally";
|
||||||
}
|
}
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user