Entity Destruction
Added multiple turret enemies Added ability to destroy enemies Fixed bug where player could target themselves Fixed bug where targeting new enemy freezes schematic hit animation Fixed bug where target lock progress could persist when targeting new enemy
This commit is contained in:
parent
eaedf0cee8
commit
e3de7158fd
13 changed files with 1937 additions and 1124 deletions
|
|
@ -52,20 +52,27 @@ public class GuidedProjectile : MonoBehaviour
|
|||
void Update ()
|
||||
{
|
||||
if (SourceEntity == null) return;
|
||||
|
||||
var diff = Target.position - transform.position;
|
||||
var targetDist = diff.magnitude;
|
||||
|
||||
if (_prevDist < targetDist)
|
||||
{
|
||||
StartCoroutine(FadeOut());
|
||||
}
|
||||
_prevDist = targetDist;
|
||||
|
||||
|
||||
var t = transform;
|
||||
|
||||
if (_active)
|
||||
{
|
||||
if (!Target)
|
||||
{
|
||||
StartCoroutine(FadeOut());
|
||||
return;
|
||||
}
|
||||
|
||||
var diff = Target.position - transform.position;
|
||||
var targetDist = diff.magnitude;
|
||||
|
||||
if (_prevDist < targetDist)
|
||||
{
|
||||
StartCoroutine(FadeOut());
|
||||
}
|
||||
_prevDist = targetDist;
|
||||
|
||||
var position = (float3) t.position;
|
||||
var sourceDist = length((float3) Source.position - position);
|
||||
var curveLerp = 1 - targetDist / (sourceDist + targetDist);
|
||||
|
|
@ -88,13 +95,9 @@ public class GuidedProjectile : MonoBehaviour
|
|||
{
|
||||
hull.SendHit(Damage, Penetration, Spread, DamageType, SourceEntity, hit, Velocity.normalized);
|
||||
}
|
||||
//if (hit.transform.gameObject.layer == 1)
|
||||
//{
|
||||
StartCoroutine(Kill());
|
||||
//}
|
||||
StartCoroutine(Kill());
|
||||
}
|
||||
if(_alive)
|
||||
t.position += Velocity * Time.deltaTime;
|
||||
t.position += Velocity * Time.deltaTime;
|
||||
}
|
||||
|
||||
IEnumerator FadeOut()
|
||||
|
|
|
|||
Loading…
Reference in a new issue