Ejemplo n.º 1
0
        // After all objects are initialized, Awake is called when the script
        // is being loaded. This occurs before any Start calls.
        // Use Awake instead of the constructor for initialization.
        public void Awake()
        {
            motor = GetComponent <Motor>();
            if (motor == null)
            {
                Debug.Log("No Motor");
            }
            motor.AddSteeringScript();
            steeringBehaviour = motor.steeringBehaviour;
            if (steeringBehaviour == null)
            {
                Debug.Log("No Steering behaviour");
            }

            GameObject mainCamera = GameObject.Find("Main Camera");

            if (mainCamera != null)
            {
                targetedCameras = mainCamera.GetComponents <TargetedCamera>();
            }

            rowsPerColumn = Mathf.Max(3, rowsPerColumn);
        }