Exemplo n.º 1
0
    private void OnTriggerExit(Collider other)
    {
        if (other.tag == Tag)
        {
            CharacterAttention OtherAttention = other.gameObject.GetComponent <CharacterAttention>();

            if (OtherAttention.GetOwner().GetAlignment() == Character.TeamAlignment.PLAYERS)
            {
                if (other.gameObject.layer != CharacterDeadLayerID ||
                    Owner.GetAlignment() == Character.TeamAlignment.PLAYERS)
                {
                    PlayerLeavesAttentionRange(OtherAttention.GetOwner());
                }
            }
            else
            {
                EnemyLeavesAttentionRange(OtherAttention.GetOwner());
            }
        }
        else if (other.tag == TagHitObjects)
        {
            SkillHitObject OtherHitObject = other.gameObject.GetComponent <SkillHitObject>();

            if ((OtherHitObject.GetAlignment() == Character.TeamAlignment.ALL ||
                 OtherHitObject.GetAlignment() == Character.TeamAlignment.ENEMIES) &&
                OtherHitObject.GetOwnerAlignment() == Character.TeamAlignment.PLAYERS)
            {
                PlayerHitObjectsInRange.Remove(OtherHitObject);
                OtherHitObject.RemoveInCharactersAttention(this);
            }
        }
    }
Exemplo n.º 2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == Tag)
        {
            CharacterAttention OtherAttention = other.gameObject.GetComponent <CharacterAttention>();

            if (OtherAttention.GetOwner().GetAlignment() == Character.TeamAlignment.PLAYERS)
            {
                PlayerEntersAttentionRange(OtherAttention.GetOwner());
            }
            else
            {
                EnemyEntersAttentionRange(OtherAttention.GetOwner());
            }
        }
        else if (other.tag == TagHitObjects || other.tag == TagPlayerHitObjects)
        {
            SkillHitObject OtherHitObject = other.gameObject.GetComponent <SkillHitObject>();

            if ((OtherHitObject.GetAlignment() == Character.TeamAlignment.ALL ||
                 OtherHitObject.GetAlignment() == Character.TeamAlignment.ENEMIES) &&
                OtherHitObject.GetOwnerAlignment() == Character.TeamAlignment.PLAYERS)
            {
                PlayerHitObjectsInRange.Add(OtherHitObject);
                OtherHitObject.AddInCharactersAttention(this);
            }
        }
    }
Exemplo n.º 3
0
    private void OnTriggerEnter(Collider other)
    {
        if (AlreadySpawned)
        {
            return;
        }

        if (other.tag == Tag)
        {
            CharacterAttention OtherAttention = other.gameObject.GetComponent <CharacterAttention>();

            if (OtherAttention.GetOwner().GetAlignment() == Character.TeamAlignment.PLAYERS)
            {
                SpawnEnemies();
                AlreadySpawned = true;
            }
        }
    }
Exemplo n.º 4
0
 public void RemoveInCharactersAttention(CharacterAttention InAttention)
 {
     InCharactersAttentions.Remove(InAttention);
 }
Exemplo n.º 5
0
 public void AddInCharactersAttention(CharacterAttention InAttention)
 {
     InCharactersAttentions.Add(InAttention);
 }