예제 #1
0
 void setAllGoalLists()
 {
     for (int i = 0; i < unitGoalGroups.Count; i++)
     {
         CM_Unit_Goal_Group cmugg = unitGoalGroups[i];
         cmugg.setGoalList(getCurrentMoveTarget());
         unitGoalGroups [i] = cmugg;
     }
 }
예제 #2
0
    public void addUnitToCombatManagerGroup(Unit u)
    {
        myUnits.Add(u);

        if (unitGoalGroups.Count == 0)
        {
            CM_Unit_Goal_Group cmugg = new CM_Unit_Goal_Group(myUnits, getCurrentMoveTarget());
            unitGoalGroups.Add(cmugg);
        }
        else
        {
            unitGoalGroups [0].addUnitToGroup(u);
        }
    }
예제 #3
0
    IEnumerator _computeCCVelocityField(CM_Unit_Goal_Group cmugg)
    {
        cce = new CCEikonalSolver(
            NavSystem.S.getCCMapPackageFromRect(cmugg.unitGoalSolutionSpace),
            NavSystem.S.getGoalAsLocations(cmugg.unitGoalSolutionSpace, cmugg.goals)
            );
        yield return(StartCoroutine(cce.WaitFor()));

        cmugg.setVelocityField(cce.v);

        if (DEBUG_EIKONAL_SOLN)
        {
            int xs = Mathf.FloorToInt(cmugg.unitGoalSolutionSpace.x);
            int ys = Mathf.FloorToInt(cmugg.unitGoalSolutionSpace.y);
            NavSystem.S._DEBUG_VISUAL_plotTileFields(new Vector2(xs, ys), cce.v);
//			NavSystem.S.theMapAnalyzer.printOutMatrix (cce.f);
        }
    }