Sector & Loadout Generation Fixes

Adjusted sector generation to improve sample elimination performance and better preserve density map
Added unit tests for item shape rotation and fit functions + fixed those (required for correct loadout generation)!
Fixed faction hostility by marking player ship
Added faction to entity serialization
Generating starting loadout for player ship
This commit is contained in:
Reinier Vens 2021-03-18 22:48:33 +00:00
commit 351cb9f2af
23 changed files with 879 additions and 128 deletions

View file

@ -36,6 +36,7 @@ public class EntityInstance : MonoBehaviour
private bool _fadedElementsVisible = false;
private bool _unfadedElementsVisible = false;
private float _fadeTime;
private bool _destroyed;
private (Reactor reactor, GameObject sfxSource) _reactor;
private Dictionary<Radiator, GameObject> _radiatorSfx = new Dictionary<Radiator, GameObject>();
@ -390,6 +391,8 @@ public class EntityInstance : MonoBehaviour
{
if (Entity.Hull.Durability < .01f)
{
if (!this) return;
_destroyed = true;
if (DestroyEffect != null)
{
var t = Instantiate(DestroyEffect).transform;