public override void UseAbility()
    {
        GameObject     go = Instantiate(instantiatePrefab, playerAbilities.transform.position, Quaternion.identity);
        AbilityDamager ad = go.GetComponent <AbilityDamager>();

        ad.teamWhoShot     = teamWhoCast;
        ad.damagePerSecond = damagePerSecond;

        go.transform.eulerAngles += new Vector3(90f, 0f, 0f);
        go.GetComponent <SphereCollider>().radius = abilityRadius;
        Destroy(go, abilityLifetime);
    }
Exemplo n.º 2
0
    public override void UseAbility()
    {
        GameObject go = Instantiate(projectilePrefab, playerAbilities.transform.position + Vector3.forward, Quaternion.identity);

        Plane plane = new Plane(Vector3.up, Vector3.zero);
        Ray   ray   = Camera.main.ScreenPointToRay(Input.mousePosition);
        float distance;

        AbilityDamager ad = projectilePrefab.GetComponent <AbilityDamager>();

        ad.teamWhoShot = teamWhoCast;

        if (plane.Raycast(ray, out distance))
        {
            point = ray.GetPoint(distance);
            go.transform.LookAt(point + (Vector3.up / 2));
        }
    }