Entity Spawning & Rendering

Entity rendering now fully supports dynamic entities from game context
Entity children now displayed underneath icon
GameContext can spawn entities by loadout
Selected corporation's initial fleet is spawned in parent corp's home sector
Properties panel API is now unified with context menu API
Properties panel labels now update dynamically
This commit is contained in:
hyperion51 2020-05-25 03:05:30 +01:00
commit 110ff883b8
25 changed files with 1019 additions and 165 deletions

View file

@ -1,4 +1,5 @@
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
@ -7,4 +8,10 @@ public class PropertyLabel : MonoBehaviour
{
public TextMeshProUGUI Name;
public TextMeshProUGUI Value;
public Func<string> ValueFunction;
private void Update()
{
Value.text = ValueFunction?.Invoke() ?? "";
}
}

View file

@ -21,11 +21,11 @@ public class ReadOnlyPropertiesPanel : MonoBehaviour
Destroy(property);
}
public void AddProperty(string name, string value)
public void AddProperty(string name, Func<string> value)
{
var property = Instantiate(PropertyPrefab, transform);
property.Name.text = name;
property.Value.text = value;
property.ValueFunction = value;
_properties.Add(property.gameObject);
}

View file

@ -0,0 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class ZoneGravityObject : ZoneObject
{
public MeshRenderer GravityMesh;
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 17a379c98cd100d4c8548e22c676d246
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -5,9 +5,10 @@ using UnityEngine;
public class ZoneObject : MonoBehaviour
{
public MeshRenderer GravityMesh;
public MeshRenderer Icon;
public TextMeshPro Label;
[HideInInspector]
public List<MeshRenderer> Children = new List<MeshRenderer>();
}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 17a379c98cd100d4c8548e22c676d246
guid: 4d8b39205d8cd404bae28355b1ed1596
MonoImporter:
externalObjects: {}
serializedVersion: 2

View file

@ -3,10 +3,7 @@ using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class ZoneShip : MonoBehaviour
public class ZoneShip : ZoneObject
{
public MeshRenderer Icon;
public TextMeshPro Label;
public Transform Thruster;
}