Esempio n. 1
0
    public void Start()
    {
        dataManager = DataManager.instance;
        infiniteObjectManager = InfiniteObjectManager.instance;
        infiniteObjectManager.init();
        infiniteObjectHistory = InfiniteObjectHistory.instance;
        infiniteObjectHistory.init(infiniteObjectManager.getTotalObjectCount());
        sectionSelection = SectionSelection.instance;
        chaseController = ChaseController.instance;

        moveDirection = Vector3.forward;
        spawnDirection = Vector3.forward;
        turnPlatform = new PlatformObject[(int)ObjectLocation.Last];

        infiniteObjectManager.getObjectSizes(out platformSizes, out sceneSizes, out largestSceneLength);
        infiniteObjectManager.getObjectStartPositions(out platformStartPosition, out sceneStartPosition);

        stopObjectSpawns = false;
        spawnData = new ObjectSpawnData();
        spawnData.largestScene = largestSceneLength;
        spawnData.useWidthBuffer = true;
        spawnData.section = 0;
        spawnData.sectionTransition = false;

        noCollidableProbability.init();

        showStartupObjects(GameManager.instance.showTutorial);

        spawnObjectRun(true);
    }
    public void Start()
    {
        cameraTransform       = Camera.main.transform;
        infiniteObjectManager = InfiniteObjectManager.instance;
        infiniteObjectManager.init();
        infiniteObjectHistory = InfiniteObjectHistory.instance;
        infiniteObjectHistory.init(infiniteObjectManager.getTotalObjectCount());
        sectionSelection = SectionSelection.instance;

        moveDirection = Vector3.forward;
        turnOffset    = Vector3.zero;
        turnPlatform  = new PlatformObject[(int)ObjectLocation.Last];

        localDistance       = new float[(int)ObjectLocation.Last];
        localSceneDistance  = new float[(int)ObjectLocation.Last];
        localPlatformHeight = new float[(int)ObjectLocation.Last];
        localSceneHeight    = new float[(int)ObjectLocation.Last];

        infiniteObjectManager.getObjectSizes(out platformSizes, out sceneSizes, out straightPlatformWidth, out largestSceneLength);

        stopObjectSpawns            = false;
        spawnData                   = new ObjectSpawnData();
        spawnData.largestScene      = largestSceneLength;
        spawnData.useWidthBuffer    = true;
        spawnData.section           = 0;
        spawnData.sectionTransition = false;

        noCollidableProbability.init();

        showStartupObjects(false);

        spawnObjectRun(true);
    }