Exemplo n.º 1
0
    private void CreateMeleeAttack()
    {
        //Grid.EventManager.RemoveListener(Constants.GameEvent.AnimationEvent, OnAnimationEvent);

        ConfigureMeleeAttack();

        GameObject loadedPrefab = Resources.Load("Melee/" + prefabName) as GameObject;

        if (loadedPrefab == null)
        {
            Debug.LogError("Prefab was null : " + prefabName);
            return;
        }

        GameObject hit       = VisualEffectManager.CreateVisualEffect(loadedPrefab, effectOrigin, Quaternion.identity);
        MeleeHit   hitScript = hit.GetComponent <MeleeHit>();

        hit.transform.SetParent(parentAbility.source.transform, true);

        hitScript.Initialize(parentEffect, layerMask, 0f, parentEffect.effectDamage);
    }
    private void CreateMeleeAttack()
    {
        ConfigureMeleeAttack();

        GameObject loadedPrefab = Resources.Load("HitPrefabs/" + prefabName) as GameObject;

        if (loadedPrefab == null)
        {
            Debug.LogError("Prefab was null : " + prefabName);
            return;
        }

        //Debug.Log("Attack Created");

        GameObject hit       = VisualEffectManager.CreateVisualEffect(loadedPrefab, effectOrigin, Quaternion.identity);
        MeleeHit   hitScript = hit.GetComponent <MeleeHit>();

        hit.transform.SetParent(parentAbility.source.transform, true);

        hitScript.Initialize(parentEffect, layerMask, 0f, parentEffect.effectDamage);
    }