Exemplo n.º 1
0
 public override void OnDeath(object sender, EventArgs e)
 {
     if (Destructible)
     {
         DeathListener.Invoke(this, e);
     }
 }
Exemplo n.º 2
0
 public void addToListeners(DeathListener listener, Aggressive A)
 {
     Dead += listener;
     if (!_deathListeningUnits.Exists((Aggressive obj) => obj == A))
     {
         _deathListeningUnits.Add(A);
     }
 }
Exemplo n.º 3
0
 void Start()
 {
     timeSpentScript  = this.GetComponent <TimeSpentInEachRoom> ();
     playerWasKilled  = false;
     deathListener    = GameObject.Find("DeathController").GetComponent <DeathListener> ();
     healthBar        = new Rect(Screen.width / 10, Screen.height * 8.75f / 10, Screen.width / 3, Screen.height / 50);
     healthBarTexture = new Texture2D(1, 1);
     healthBarTexture.SetPixel(0, 0, Color.red);
     healthBarTexture.Apply();
 }
Exemplo n.º 4
0
 private void RegisterDeathListener(DeathListener listener)
 {
     if (listener == null)
     {
         throw new ArgumentNullException();
     }
     if (listeners.Contains(listener))
     {
         throw new ArgumentException(string.Format("Listener {0} already added.", listener));
     }
     this.listeners.Add(listener);
 }
Exemplo n.º 5
0
 public void Subscribe(DeathListener d)
 {
     listeners.Add(d);
 }
Exemplo n.º 6
0
 public virtual void OnDeath(object sender, EventArgs e)
 {
     DeathListener?.Invoke(this, e);
 }
Exemplo n.º 7
0
 public void Init(DeathListener listener)
 {
     RegisterDeathListener(listener);
     SetRandomColor();
 }
Exemplo n.º 8
0
 public void RemoveFromListeners(DeathListener listener, Aggressive A)
 {
     Dead -= listener;
     _deathListeningUnits.Remove(A);
 }
Exemplo n.º 9
0
 public void addDeathListener(DeathListener dl)
 {
     deathListeners.Add(dl);
     Debug.Log("Death Listener added");
 }
Exemplo n.º 10
0
 public void RegisterDeathListener(DeathListener deathListener)
 {
     this.deathListener = deathListener;
 }
Exemplo n.º 11
0
 public Aggressive(Point2D position, ref VirtualIntelligence Master, ref IMoveUnitStats AggressiveStats) : base(position, ref Master, ref AggressiveStats)
 {
     _listener  = new DeathListener(diaog);
     _unitStats = (AggressiveMoveUnitStats)AggressiveStats;
 }
Exemplo n.º 12
0
	public void addDeathListener(DeathListener dl) {
		deathListeners.Add (dl);
		Debug.Log("Death Listener added");
	}