Esempio n. 1
0
    void Shoot(char selected)
    {
        GameObject shot;

        switch (selected)
        {
        case 'Q':
            break;

        case 'W':
            shot = Instantiate(AbilityW, RF.Mouse.transform.position, transform.rotation);
            shot.GetComponent <BrandW>().Set(1000);
            break;

        case 'E':
            break;

        case 'R':
            shot = Instantiate(AbilityQ, transform.position, transform.rotation);
            shot.GetComponent <BrandR>().Set(target, 100);
            break;
        }

        CharacterPlayerNav.StopMoving();
        target = null;
    }
Esempio n. 2
0
    void AutoAttack()
    {
        transform.LookAt(target);

        //  Fire an auto.
        GameObject auto = Instantiate(Auto, transform.position, transform.rotation);

        //  Set the auto's target and damage.
        auto.GetComponent <AutoProjectile>().Set(target, AutoDamage);

        //  Stop moving when in range.
        if (PlayerNav == null)
        {
            throw new NullReferenceException("PlayerNav is set to null for: " + _name);
        }
        else
        {
            PlayerNav.StopMoving();
        }
    }