Esempio n. 1
0
    void Start()
    {
        boidsgui = GetComponent <BoidsGUI>();

        limitedVelocity = 0.6f;
        for (int i = 0; i < count; ++i) // spawn gameobject then add it to the list
        {
            GameObject fish;
            position = new Vector3(Random.Range(10.0f, -10.0f), Random.Range(1.5f, 10.0f), Random.Range(10.0f, -10.0f));
            fish     = Instantiate(BoidPreb) as GameObject;
            fish.transform.position = position;
            fish.transform.parent   = gameObject.transform;
            fishgold.Add(fish);
        }

        Target = Instantiate(TargetPreb) as GameObject;
        Target.transform.position = new Vector3(0, 35, -40);
    }
Esempio n. 2
0
    void Start()
    {
        boidsgui = GetComponent<BoidsGUI>();

        limitedVelocity = 0.6f;
        for (int i = 0; i < count; ++i) // spawn gameobject then add it to the list
        {
            GameObject fish;
            position = new Vector3(Random.Range(10.0f, -10.0f), Random.Range(1.5f, 10.0f), Random.Range(10.0f, -10.0f));
            fish = Instantiate(BoidPreb) as GameObject;
            fish.transform.position = position;
            fish.transform.parent = gameObject.transform;
            fishgold.Add(fish);
        }

        Target = Instantiate(TargetPreb) as GameObject;
        Target.transform.position = new Vector3(0, 35, -40);
    }