Пример #1
0
 protected override void Colliding(Behaviour1D other)
 {
     if (other is ChomperBehaviour)
     {
         Damaged(other);
     }
 }
Пример #2
0
    protected override void Colliding(Behaviour1D other)
    {
        var damageable = other as IDamageable;

        if (damageable != null)
        {
            damageable.Damaged(this);
        }
    }
Пример #3
0
    public void Damaged(Behaviour1D damager)
    {
        _currentHealth -= 1;

        if (_currentHealth == 0)
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
        }
    }
Пример #4
0
    public MapEntry Register(int position, Behaviour1D content)
    {
        if (!map.ContainsKey(position))
        {
            map.Add(position, new List <MapEntry>());
        }

        MapEntry entry = new MapEntry();

        entry.content  = content;
        entry.position = position;

        map[position].Add(entry);

        return(entry);
    }
Пример #5
0
 public void Damaged(Behaviour1D damager)
 {
     Destroy(gameObject);
 }
Пример #6
0
 private void OnEnable()
 {
     _target = target as Behaviour1D;
 }
Пример #7
0
 protected virtual void Colliding(Behaviour1D other)
 {
 }