Trailer Stuff & More

Changed title font to Montserrat
Added trailer-specific camera transitions
Added key to hide UI
Fixed input listening while console is open
Added animated zone reveal effect in galaxy map
Added Ping action for sensors
Added debug console commands (e.g. give command to get any item in legendary+ quality)
Temporarily disabled wwise
Fixed infinite loop in weapon penetration code
Guided missiles now predict target position
Fixed hitscan weapons
Fixed invisible enemies bug
Fixed various loadout generator issues (can now generate turrets!)
Fixed wormhole crash when enemy is targeted
Saving/loading current zone time when exiting game (planets keep their positions)
Created slime simulation in test scene - WIP
This commit is contained in:
Reinier Vens 2021-03-27 10:03:24 +00:00
commit 11a9365f91
108 changed files with 10049 additions and 856 deletions

View file

@ -7,6 +7,7 @@ using static Unity.Mathematics.math;
using static Unity.Mathematics.noise;
using Random = UnityEngine.Random;
using static Noise1D;
using float3 = Unity.Mathematics.float3;
public class GuidedProjectile : MonoBehaviour
{
@ -31,6 +32,8 @@ public class GuidedProjectile : MonoBehaviour
private float _prevDist;
private bool _active;
private bool _alive;
private Vector3 _targetVelocity;
private Vector3 _previousTargetPosition;
public Transform Target { get; set; }
public float3 StartPosition { get; set; }
@ -42,6 +45,8 @@ public class GuidedProjectile : MonoBehaviour
public DamageType DamageType { get; set; }
public Entity SourceEntity { get; set; }
public event Action OnKill;
void OnEnable()
{
_active = _alive = true;
@ -67,12 +72,15 @@ public class GuidedProjectile : MonoBehaviour
StartCoroutine(FadeOut());
return;
}
var position = (float3) t.position;
var targetPosition = TargetPosition?.Invoke() ?? Target.position;
_targetVelocity = lerp(_targetVelocity, targetPosition - _previousTargetPosition, saturate(Time.deltaTime * 5));
_previousTargetPosition = targetPosition;
targetPosition = AetheriaMath.FirstOrderIntercept(position,float3.zero, TopSpeed, targetPosition, _targetVelocity);
var diff = targetPosition - transform.position;
var targetDist = diff.magnitude;
var position = (float3) t.position;
var sourceDist = length(StartPosition.xz - position.xz);
if (sourceDist > Range || dot(diff,Velocity) < 0)
@ -212,6 +220,7 @@ public class GuidedProjectile : MonoBehaviour
{
yield return null;
}
OnKill?.Invoke();
GetComponent<Prototype>().ReturnToPool();
}
}