blob: f515e96db8ab956b5b92e57dc410692bd5b88ce0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
using UnityEngine;
public class PerkRangeModifyer : MonoBehaviour
{
public Equippable requiredPerk;
public float rangeMultiplyer;
public AutoAttack autoAttack;
public PathfindMovementPlayerunit pathfindMovement;
private void Start()
{
if (PerkManager.IsEquipped(requiredPerk))
{
foreach (TargetPriority targetPriority in autoAttack.targetPriorities)
{
targetPriority.range *= rangeMultiplyer;
}
if ((bool)pathfindMovement)
{
pathfindMovement.keepDistanceOf *= rangeMultiplyer;
}
}
Object.Destroy(this);
}
}
|