public void Sacrifice(VillagerAI target) { target.GetComponent <SacrificeParticles>().SpawnSacrificeParticles(); Destroy(target.gameObject); InfluenceManager.Instance.AddInfluence(influencePerSacrifice); SoundManager.Instance.CreatePlayAndDestroy(SoundManager.Instance.sacrificeSounds[UnityEngine.Random.Range(0, 2)], 0.1f); OnSacrifice?.Invoke(); }
private void OnTriggerEnter(Collider other) { Destroyable destroyable = other.gameObject.GetComponentInParent <Destroyable>(); if (destroyable != null) { _particles.Emit(50); Destroy(other.gameObject); OnSacrifice?.Invoke(); } }
void Sacrifice(Villager villager) { m_CurrentSacrificeCount++; SacrificeCountText.text = string.Format("{0}/{1}", m_CurrentSacrificeCount, m_SacrificeCount); OnSacrifice?.Invoke(villager); this.GetComponentInChildren <Button>().interactable = true; if (m_CurrentSacrificeCount == m_SacrificeCount) { CloseView(); } }