private void SpawnBullet(IMapController mapController) { _bullet = new EnemyBullet(Direction, 1, this); _bullet.Position = Position.Clone(); DirectionalMovement.Move(Direction, _bullet.Position); var wasSpawned = mapController.Spawn(_bullet); if (!wasSpawned) { _bullet = null; } }
private void Update() { if (m_Movement != null) { Vector3 movement3d = new Vector3(m_MovementDirection.x, 0f, m_MovementDirection.y); m_Movement.Move(movement3d, Time.deltaTime); } GameObject objectInSight = m_Detection.GetObjectInSight(); if (objectInSight) { Debug.Log("Object " + name + " has " + objectInSight.name + " in sight!"); } }
public override void Move() { DirectionalMovement.Move(Direction, Position); }
public override void Move() { ChangeDirection(); DirectionalMovement.Move(Direction, Position); }