void Init()
    {
        // cache ref to our transform
        myTransform = transform;

        // cache ref to the camera
        Camera mainCam = Camera.main;

        if (mainCam == null)
        {
            return;
        }

        cameraTransform = mainCam.transform;

        // tell waypoint controller if we want to reverse the path or not
        waypointControl.SetReverseMode(shouldReversePath);

        totalSpawnObjects = spawnObjectPrefabs.Length;

        if (shouldAutoStartSpawningOnLoad)
        {
            StartWave(totalAmountToSpawn, timeBetweenSpawns);
        }
    }
    void Init()
    {
        myTransfrom = transform;

        Camera mainCam = Camera.main;

        if (mainCam == null)
        {
            return;
        }
        cameraTransform = mainCam.transform;

        waypointControl.SetReverseMode(shouldReversePath);
        totalSpawnObjects = spwanObjectPrefabs.Length;

        if (shouldAutoRespawningOnLoad)
        {
            StartWave(totalAmountToSpawn, timeBetweenSpawn);
        }
    }