From 260a6c9941737bf4b238e4a8ef685be11eb8e641 Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 14 Aug 2015 12:57:47 -0400 Subject: [PATCH] - Updated Capture function and AbandonUnit function. --- Assets/Scripts/Squad.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Assets/Scripts/Squad.cs b/Assets/Scripts/Squad.cs index bd4b071..1f3a4c4 100644 --- a/Assets/Scripts/Squad.cs +++ b/Assets/Scripts/Squad.cs @@ -134,6 +134,12 @@ public class Squad : Unit { // retreive the human at the specified index var humanUnit = _humans.ElementAt(i); + // reassign the human attributes + humanUnit.Tag = TagLayerManager.Human; + humanUnit.Layer = TagLayerManager.HumanLayerIndex; + humanUnit.gameObject.GetComponent().useGravity = true; + humanUnit.IsCaptured = false; + // add the human to the abandonned Unit list AddAbandonnedHuman(humanUnit); // remove the human from the humandUnit that was added to the abandonned unit list @@ -219,6 +225,7 @@ public class Squad : Unit //Debug.Log(String.Format("Human parent before colision :{0}", unit.transform.name)); unit.IsCaptured = true; unit.transform.parent = this.transform; + unit.transform.gameObject.GetComponent().useGravity = false; unit.transform.localPosition = new Vector3(0, 0, 0); //Debug.Log(String.Format("Human parent before colision :{0}", unit.transform.parent.name)); AddHuman(unit);