Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     aligned    = new Align();
     looky      = new Look_Where_Going();
     facing     = new Face();
     pathFollow = new Path_Follow();
     seeking    = new Seek_And_Flee();
     separate   = new Separation();
     pursuing   = new Pursue();
     avoid      = new CollisionAvoidance();
     obstacles  = new Obstacle_Avoidance();
 }
    // Use this for initialization
    void Start()
    {
        arrive     = new Arrival();
        aligned    = new Align();
        looky      = new Look_Where_Going();
        facing     = new Face();
        pathFollow = new Path_Follow();
        seeking    = new Seek_And_Flee();
        separate   = new Separation();
        pursuing   = new Pursue();
        avoid      = new CollisionAvoidance();
        obstacles  = new Obstacle_Avoidance();
        flocking   = new Blended_Steering();

        behaviors = new BehaviorAndWeight[4];
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        arrive     = new Arrival();
        aligned    = new Align();
        looky      = new Look_Where_Going();
        facing     = new Face();
        pathFollow = new Path_Follow();
        seeking    = new Seek_And_Flee();
        separate   = new Separation();
        pursuing   = new Pursue();
        avoid      = new CollisionAvoidance();
        obstacles  = new Obstacle_Avoidance();
        flocking   = new Blended_Steering();
        //finding = new Pathfinder();

        behaviors = new BehaviorAndWeight[4];

        // Use if doing Path Finding:
        //Graph myGraph = new Graph();

        //myGraph.Build();

        //List<Connection> path = Dijkstra.pathfind(myGraph, start, goal);

        //// path is a list of connections - convert this to gameobjects for the FollowPath steering behavior

        //aiTargets = new GameObject[path.Count + 1];

        //int i = 0;

        //foreach (Connection c in path)

        //{

        //    Debug.Log("from " + c.getFromNode() + " to " + c.getToNode() + " @" + c.getCost());

        //    aiTargets[i] = c.getFromNode().gameObject;

        //    i++;

        //}

        //aiTargets[i] = goal.gameObject;
    }