Наследование: MonoBehaviour
Пример #1
0
    void Start()
    {
        BoidWatcher boidWatcher = watcher.GetComponent <BoidWatcher>();

        boidObjects = GameObject.FindGameObjectsWithTag("Boid");
        watcherRb   = watcher.GetComponent <Rigidbody>();

        foreach (GameObject boid in boidObjects)
        {
            rigidbodies.Add(boid.GetComponent <Rigidbody>());
        }
    }
Пример #2
0
    void Start()
    {
        isDivided = false;
        BoidWatcher boidWatcher = watcher.GetComponent <BoidWatcher>();

        watcherRb = watcher.GetComponent <Rigidbody>();

        boidObjects = GameObject.FindGameObjectsWithTag("Boid");
        foreach (GameObject boid in boidObjects)
        {
            rigidbodies.Add(boid.GetComponent <Rigidbody>());
            boid.SetActive(false);
        }

        Debug.Log(boidObjects.Length);
    }