Slimes can now cross tile boundaries.
This commit is contained in:
@@ -68,15 +68,19 @@ namespace Assets.Scripts.InteractableObjects
|
||||
{
|
||||
if (col.name.Contains("_") && col.gameObject == gameObject.transform.parent.gameObject)
|
||||
{
|
||||
gameObject.GetComponent<Rigidbody>().AddForce(gameObject.GetComponent<Rigidbody>().linearVelocity * -2, ForceMode.Impulse);
|
||||
col.gameObject.GetComponent<Tile>().aliveEnemies.Remove(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleAttack()
|
||||
void OnTriggerEnter(Collider col)
|
||||
{
|
||||
//TODO: Force Fight start
|
||||
if (col.name.Contains("_") && col.gameObject != gameObject.transform.parent.gameObject)
|
||||
{
|
||||
col.gameObject.GetComponent<Tile>().aliveEnemies.Add(gameObject);
|
||||
gameObject.transform.SetParent(col.gameObject.transform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void handleFollow(bool isFollowing)
|
||||
{
|
||||
followsPlayer = isFollowing;
|
||||
|
||||
@@ -13,7 +13,7 @@ public class Tile : MonoBehaviour
|
||||
System.Random rand = new System.Random();
|
||||
TileType tiletype;
|
||||
GameObject contentGenerator;
|
||||
List<GameObject> aliveEnemies = new List<GameObject>();
|
||||
public List<GameObject> aliveEnemies = new List<GameObject>();
|
||||
|
||||
public void generateTile(Vector3 pos, TileType type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user