示例#1
0
    public override void Use(WeaponSystem weaponSystem, int abilityIndex)
    {
        weaponSystem.SetCooldown(abilityIndex, cooldown);
        GameObject instance = Instantiate(grenadeObject, weaponSystem.transform.position + weaponSystem.GetCamera().transform.forward, Quaternion.identity) as GameObject;

        instance.GetComponent <Rigidbody>().AddForce(weaponSystem.GetCamera().transform.forward *throwForce);
        instance.GetComponent <GravityGrenadeObject>().Setup(pullForce, pullRadius, weaponSystem);
    }
示例#2
0
    public override void Use(WeaponSystem weaponSystem, int abilityIndex)
    {
        weaponSystem.SetCooldown(abilityIndex, cooldown);
        GameObject instance = Instantiate(shieldObject, weaponSystem.transform.position + (weaponSystem.GetCamera().transform.forward / 2), weaponSystem.GetCamera().transform.rotation, weaponSystem.GetCamera().transform) as GameObject;

        instance.GetComponent <EnergyShieldObject>().Setup(duration);
    }