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
29
30
31
32
33
34
35
36
37
38
39
|
using System;
using Photon.Pun;
using UnityEngine;
public class Implosion : MonoBehaviour
{
public float force;
public float drag;
public float time;
public float clampDist;
private void Start()
{
Explosion component = GetComponent<Explosion>();
component.HitTargetAction = (Action<Damagable, float>)Delegate.Combine(component.HitTargetAction, new Action<Damagable, float>(HitTarget));
clampDist *= base.transform.localScale.x;
force *= base.transform.localScale.x;
}
public void HitTarget(Damagable damageble, float distance)
{
DoPull(damageble, distance);
}
private void DoPull(Damagable damageble, float distance)
{
bool num = GetComponent<SpawnedAttack>().IsMine();
HealthHandler component = damageble.GetComponent<HealthHandler>();
CharacterData component2 = damageble.GetComponent<CharacterData>();
_ = (Vector2)((base.transform.position - component.transform.position) * 0.25f);
if (num)
{
component2.view.RPC("RPCA_SendForceTowardsPointOverTime", RpcTarget.All, force, drag, clampDist, (Vector2)base.transform.position, time, 0, false, false);
}
}
}
|