private void TickWeapon() { m_ClosestEnemyData = EnemySearch.GetClosestEnemy(m_View.transform.position, m_MaxDistance, m_NodeCircle); if (m_ClosestEnemyData == null) { m_LineRenderer.gameObject.SetActive(false); Debug.Log("Closest enemy null!"); return; } else { var closestEnemyPosition = m_ClosestEnemyData.View.transform.position; m_View.TowerLookAt(closestEnemyPosition); Vector3 projectileOriginPosition = m_View.ProjectileOrigin.position; m_LineRenderer.SetPosition(0, projectileOriginPosition); m_LineRenderer.SetPosition(1, closestEnemyPosition); m_LineRenderer.gameObject.SetActive(true); } TickTower(); Debug.Log("Hit Lazer!"); m_ClosestEnemyData.GetDamage(m_Damage * Time.deltaTime); }
private void TickTower() { if (m_ClosestEnemy != null) { m_View.TowerLookAt(m_ClosestEnemy.View.transform.position); } }
private void TickTower() { if (m_ClosestEnemyData != null && !m_ClosestEnemyData.isDead) { m_View.TowerLookAt(m_ClosestEnemyData.View.transform.position); } }
private void TickTower() { if (m_ClosestEnemyData != null) { Debug.Log("Enemy not null!"); m_View.TowerLookAt(m_ClosestEnemyData.View.transform.position); } }
private void TickTower() { if (CheckClosest()) { m_LineRenderer.SetPosition(1, m_View.ProjectileOrigin.position); m_LineRenderer.SetPosition(0, m_ClosestEnemyData.View.transform.position); m_View.TowerLookAt(m_ClosestEnemyData.View.transform.position); } }
public void TickShoot() { m_ClosestEnemyData = EnemySearch.GetClosestEnemy(m_View.transform.position, m_MaxDistance, m_Nodes); if (m_ClosestEnemyData == null) { m_LineRenderer.gameObject.SetActive(false); } else { Vector3 closestEnemyPosition = m_ClosestEnemyData.View.transform.position; m_View.TowerLookAt(closestEnemyPosition); m_LineRenderer.SetPosition(0, m_View.ProjectileOrigin.position); m_LineRenderer.SetPosition(1, closestEnemyPosition); m_LineRenderer.gameObject.SetActive(true); m_ClosestEnemyData.GetDamage(m_Damage * Time.deltaTime); //Debug.Log("Dealt damage"); } }