private void CreateFormation() { for (int i = 0; i < totalAgent; i++) { GameObject go = GameObject.CreatePrimitive(PrimitiveType.Capsule); NavIndividual individual = go.AddComponent <IndividualAgent>().individual; group.individualList.Add(individual); } SquareFormation f = new SquareFormation(); f.InitFormation(this.transform.position, this.transform.forward, totalAgent, rowCount, radius); group.AssignFormation(f); }
public void Form() { int countWithOverride = this.GetUnitCountWithOverride(); int minimumWidth; int maximumDepth = SquareFormation.GetMaximumDepth(countWithOverride, out minimumWidth); if (countWithOverride <= minimumWidth * (minimumWidth - 1)) { this.DisableRearOfLastRank = true; } else { this.DisableRearOfLastRank = false; } this.FormFromDepth(maximumDepth); }
public void Test() { f = new SquareFormation(); f.InitFormation(this.transform.position, this.transform.forward, totalAgent, rowCount, radius); }