Пример #1
0
    public override void OnCollisionHitEvent(Collision2D collision, GameObject src, OnCollisionData data)
    {
        GameObject         target_obj = collision.gameObject;
        SpellPrefabManager s_manager  = src.GetComponent <SpellPrefabManager>();

        SpellUtilities.DamageOnCollide(
            collision.gameObject, s_manager, data.m_ApplyDamage.m_Damage, data.m_ApplyDamage.m_ValidHitActors, data.m_ApplyDamage.m_DamageType);
    }
Пример #2
0
    public override void OnCollisionHitEvent(Collision2D collision, GameObject src, OnCollisionData data)
    {
        GameObject target_obj = collision.gameObject;

        Debug.Log("invalids = ");
        foreach (var str in data.m_DestroySelfData.m_ValidHitActors)
        {
            Debug.Log(str);
        }
        Debug.Log("Hitted Actor tag = " + collision.gameObject.tag);
        SpellPrefabManager s_manager = src.GetComponent <SpellPrefabManager>();

        if (target_obj != s_manager.GetOwner() && GameplayStatics.ObjHasTag(target_obj, data.m_DestroySelfData.m_ValidHitActors))
        {
            GameObject.Destroy(src);
        }
    }
Пример #3
0
    public override void OnCollisionHitEvent(Collision2D collision, GameObject src, OnCollisionData data)
    {
        var m_SpellToCast = data.m_CastSpellOnHitData.m_Spell;

        if (!m_SpellToCast)
        {
            return;
        }
        var invalids = data.m_CastSpellOnHitData.m_invalid;
        SpellPrefabManager s_manager = src.GetComponent <SpellPrefabManager>();

        if (!data.m_CastSpellOnHitData.m_EnemyOnly)
        {
            SpellUtilities.CastSpellOnCollide(collision.gameObject, s_manager, m_SpellToCast, GameplayStatics.GetTriggerContactPoint(collision.gameObject, src), invalids);
        }
        else if (collision.gameObject.CompareTag("Enemy"))
        {
            SpellUtilities.CastSpellOnCollide(collision.gameObject, s_manager, m_SpellToCast, GameplayStatics.GetTriggerContactPoint(collision.gameObject, src));
        }
    }
Пример #4
0
 public abstract void OnCollisionHitEvent(Collision2D collision, GameObject src, OnCollisionData data);
Пример #5
0
 public abstract void OnTriggerHitEvent(Collider2D collision, GameObject src, OnCollisionData data);