- multiple new skeletons - necromancer class - necromancer first ability tryouts - drain projectile script
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using Photon.Pun;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class NetworkDrainEffectChainReaction : NetworkAbilityChainReaction
|
|
{
|
|
NetworkedDrainProjectile drainProjectile;
|
|
|
|
public override void ExecuteAbilityChainReaction(PhotonView owner, Taggable ownerTag, List<Taggable> targets)
|
|
{
|
|
if (!owner.IsMine) return;
|
|
|
|
for (int i = 0; i < targets.Count; i++)
|
|
{
|
|
spawnedChainReaction = PhotonNetwork.Instantiate("Abilities/" + abilityPrefabName.name, targets[i].transform.position + Vector3.up*0.5f, Quaternion.identity);
|
|
|
|
drainProjectile = spawnedChainReaction.GetComponent<NetworkedDrainProjectile>();
|
|
|
|
drainProjectile.speed = ((ProjectileAbility)ability).projectileSpeed;
|
|
drainProjectile.owner = owner;
|
|
drainProjectile.ownerTag = ownerTag;
|
|
drainProjectile.ability = ((ProjectileAbility)ability);
|
|
drainProjectile.lifeSpan = ((ProjectileAbility)ability).lifeSpan;
|
|
|
|
drainProjectile.Init();
|
|
}
|
|
|
|
}
|
|
}
|