Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        b = GetComponent <Boid>();
        EagleSpawner es = FindObjectOfType <EagleSpawner>();

        leader = es.fleet[0];
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        es = FindObjectOfType <EagleSpawner>();

        //if there is a leader then look at him
        if (es.fleet.Count > 0)
        {
            position = es.fleet[0].transform.position;
            this.transform.LookAt(position);
        }
    }