/***************************************************/ /*** METHODS ************************/ /***************************************************/ /******** UNITY MESSAGES ************************/ private void Awake() { if (m_instance != null) { Destroy(gameObject); } else { m_instance = this; } }
void Shoot(ONEGeneral.Direction p_direction, GameObject p_projectileSpawn) { if (p_projectileSpawn == null) { return; } GameObject created = Instantiate(p_projectileSpawn, transform.parent); created.transform.localPosition = m_destination; ProjectileSpawn script = created.GetComponent <ProjectileSpawn>(); Debug.Assert(script != null); script.Direction = p_direction; script.PlayMyTurn(); ONESoundDesign.EnemyShoot(); }
public void Hit(int p_damage) { m_currentLifePoint -= p_damage; ONESoundDesign.EnemyHurt(); if (m_currentLifePoint <= 0) { if (m_loot) { GameObject created = Instantiate(m_loot, transform.parent); created.transform.localPosition = m_destination; } Debug.Log(name + " diededed ! x("); Destroy(gameObject); } }
public void Shoot(Transform p_parent, Vector3 p_position, ONEGeneral.Direction p_direction) { if (m_projectileSpawn == null || m_currentCooldown != 0) { Debug.Log("Can't shoot"); return; } GameObject created = Instantiate(m_projectileSpawn, p_parent); created.transform.localPosition = p_position; ProjectileSpawn script = created.GetComponent <ProjectileSpawn>(); script.IsFromPlayer = true; script.Direction = p_direction; Debug.Assert(script != null); m_currentCooldown = m_cooldown + 1; ONESoundDesign.PlayerShoot(); }
// Hit me master public void Hit(int p_damage) { m_currentLifePoint -= p_damage; ONESoundDesign.PlayerHurt(); }