aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'nGJ2019/Assets')
-rw-r--r--nGJ2019/Assets/Scripts/SwarmSystem.cs402
1 files changed, 402 insertions, 0 deletions
diff --git a/nGJ2019/Assets/Scripts/SwarmSystem.cs b/nGJ2019/Assets/Scripts/SwarmSystem.cs
new file mode 100644
index 0000000..d33595a
--- /dev/null
+++ b/nGJ2019/Assets/Scripts/SwarmSystem.cs
@@ -0,0 +1,402 @@
+using UnityEngine;
+using System.Collections.Generic;
+
+public class SwarmSystem : MonoBehaviour
+{
+ public GameObject swarmPrefab;
+ public int size = 1;
+
+ public bool showGuides = false;
+
+ private List<Transform> units = new List<Transform>();
+ private List<Vector3> boneStarts = new List<Vector3>();
+ private List<Vector3> boneEnds = new List<Vector3>();
+ private List<Transform> boneTransforms = new List<Transform>();
+ private List<Transform> boneTips = new List<Transform>();
+ private List<int> boneCenterStarts = new List<int>();
+ private List<float> boneCenterDists = new List<float>();
+
+ private SkinnedMeshRenderer meshRender;