void OnTriggerExit(Collider other) { if (other.gameObject.GetComponent <TankActor>().m_team1unit) { m_tank = null; } }
void OnTriggerExit(Collider other) { if (other.gameObject.GetComponent <TankActor>().m_team2unit) { m_tank = null; markerMaterial.color = Color.green; } }
void OnTriggerEnter(Collider other) { if (other.gameObject.GetComponent <TankActor>().m_team2unit) { m_tank = other.GetComponent <TankActor>(); markerMaterial.color = Color.red; } }
public GameData(TankActor tankActor) { playerScore = PickupManager.GetPlayerScore(); playerHealth = tankActor.healthComp.currentHP; numPickupsCollected = PickupManager.GetNumCollectedPickups(); numPickupsLost = PickupManager.GetNumLostPickups(); numPickupsTotal = PickupManager.GetNumPickupsInLevel(); levelNum = LevelManager.GetLevelNum(); }
void SetGeneral() { foreach (TankActor tank in m_squad.ToList()) { if (tank.m_isGeneral) { m_currentGeneral = tank; } } }
public void AttackEnemy(TankActor enemy) { m_turret.transform.LookAt(enemy.transform); m_agent.SetDestination(enemy.transform.position); if (Vector3.Distance(transform.position, enemy.transform.position) <= 20.0f) { m_agent.stoppingDistance = 15.0f; m_AttackTimer -= Time.deltaTime; if (m_AttackTimer <= 0.0f) { enemy.TakeDamage(20); m_AttackTimer = m_AttackTime; } } }
private void Awake() { _panel = GetComponent <Image>(); _tankActor = FindObjectOfType <TankActor>(); _healthComp = _tankActor.GetComponent <HealthComponent>(); if (!_panel) { Debug.LogError("Failed to get Image on " + gameObject.name.ToString() + ", creating one now..."); _panel = gameObject.AddComponent <Image>(); } if (!_tankActor) { Debug.LogError("Failed to find TankActor reference in TankHealthBox!"); } _panel.fillAmount = minFillValue; _healthComp.OnHealthModified += UpdateHealth; }
public void setEnemy(TankActor enemy) { m_enemy = enemy; }
public void FollowGeneral(TankActor general) { m_agent.SetDestination(general.transform.position); }