コード例 #1
0
ファイル: GroupAgent.cs プロジェクト: skmang/UnityPlayground
    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);
    }
コード例 #2
0
        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);
        }
コード例 #3
0
 public void Test()
 {
     f = new SquareFormation();
     f.InitFormation(this.transform.position, this.transform.forward, totalAgent, rowCount, radius);
 }