示例#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];
            turnIndex      = new int[(int)ObjectLocation.Last];
            turnScene      = new SceneObject[(int)ObjectLocation.Last];
            sceneTurnIndex = new int[(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);

            GameManager.instance.OnStartGame += StartGame;
        }
        public void Init(int objectCount)
        {
            activeObjectLocation          = ObjectLocation.Center;
            objectSpawnIndex              = new List <int> [(int)ObjectLocation.Last];
            objectTypeSpawnIndex          = new int[(int)ObjectLocation.Last][];
            lastLocalIndex                = new int[(int)ObjectLocation.Last][];
            latestObjectTypeSpawnDistance = new float[(int)ObjectLocation.Last][];
            lastObjectSpawnDistance       = new List <float> [(int)ObjectLocation.Last];

            objectLocationAngle = new float[(int)ObjectLocation.Last];

            totalDistance      = new float[(int)ObjectLocation.Last];
            totalSceneDistance = new float[(int)ObjectLocation.Last];

            platformDistanceDataMap = new PlatformDistanceDataMap[(int)ObjectLocation.Last];

            topPlatformObjectSpawned    = new InfiniteObject[(int)ObjectLocation.Last];
            bottomPlatformObjectSpawned = new InfiniteObject[(int)ObjectLocation.Last];
            topSceneObjectSpawned       = new InfiniteObject[(int)ObjectLocation.Last];
            bottomSceneObjectSpawned    = new InfiniteObject[(int)ObjectLocation.Last];

            previousPlatformSection          = new int[(int)ObjectLocation.Last];
            previousSceneSection             = new int[(int)ObjectLocation.Last];
            spawnedPlatformSectionTransition = new bool[(int)ObjectLocation.Last];
            spawnedSceneSectionTransition    = new bool[(int)ObjectLocation.Last];

            for (int i = 0; i < (int)ObjectLocation.Last; ++i)
            {
                objectSpawnIndex[i]              = new List <int>();
                objectTypeSpawnIndex[i]          = new int[(int)ObjectType.Last];
                lastLocalIndex[i]                = new int[(int)ObjectType.Last];
                latestObjectTypeSpawnDistance[i] = new float[(int)ObjectType.Last];

                lastObjectSpawnDistance[i] = new List <float>();

                platformDistanceDataMap[i] = new PlatformDistanceDataMap();

                for (int j = 0; j < objectCount; ++j)
                {
                    objectSpawnIndex[i].Add(-1);
                    lastObjectSpawnDistance[i].Add(0);
                }
                for (int j = 0; j < (int)ObjectType.Last; ++j)
                {
                    objectTypeSpawnIndex[i][j]          = -1;
                    lastLocalIndex[i][j]                = -1;
                    latestObjectTypeSpawnDistance[i][j] = -1;
                }
            }

            infiniteObjectManager = InfiniteObjectManager.instance;
        }
        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];
            turnIndex = new int[(int)ObjectLocation.Last];
            turnScene = new SceneObject[(int)ObjectLocation.Last];
            sceneTurnIndex = new int[(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);

            GameManager.instance.OnStartGame += StartGame;
        }
        public void Init(int objectCount)
        {
            activeObjectLocation = ObjectLocation.Center;
            objectSpawnIndex = new List<int>[(int)ObjectLocation.Last];
            objectTypeSpawnIndex = new int[(int)ObjectLocation.Last][];
            lastLocalIndex = new int[(int)ObjectLocation.Last][];
            latestObjectTypeSpawnDistance = new float[(int)ObjectLocation.Last][];
            lastObjectSpawnDistance = new List<float>[(int)ObjectLocation.Last];

            objectLocationAngle = new float[(int)ObjectLocation.Last];

            totalDistance = new float[(int)ObjectLocation.Last];
            totalSceneDistance = new float[(int)ObjectLocation.Last];

            platformDistanceDataMap = new PlatformDistanceDataMap[(int)ObjectLocation.Last];

            topPlatformObjectSpawned = new InfiniteObject[(int)ObjectLocation.Last];
            bottomPlatformObjectSpawned = new InfiniteObject[(int)ObjectLocation.Last];
            topSceneObjectSpawned = new InfiniteObject[(int)ObjectLocation.Last];
            bottomSceneObjectSpawned = new InfiniteObject[(int)ObjectLocation.Last];

            previousPlatformSection = new int[(int)ObjectLocation.Last];
            previousSceneSection = new int[(int)ObjectLocation.Last];
            spawnedPlatformSectionTransition = new bool[(int)ObjectLocation.Last];
            spawnedSceneSectionTransition = new bool[(int)ObjectLocation.Last];

            for (int i = 0; i < (int)ObjectLocation.Last; ++i) {
                objectSpawnIndex[i] = new List<int>();
                objectTypeSpawnIndex[i] = new int[(int)ObjectType.Last];
                lastLocalIndex[i] = new int[(int)ObjectType.Last];
                latestObjectTypeSpawnDistance[i] = new float[(int)ObjectType.Last];

                lastObjectSpawnDistance[i] = new List<float>();

                platformDistanceDataMap[i] = new PlatformDistanceDataMap();

                for (int j = 0; j < objectCount; ++j) {
                    objectSpawnIndex[i].Add(-1);
                    lastObjectSpawnDistance[i].Add(0);
                }
                for (int j = 0; j < (int)ObjectType.Last; ++j) {
                    objectTypeSpawnIndex[i][j] = -1;
                    lastLocalIndex[i][j] = -1;
                    latestObjectTypeSpawnDistance[i][j] = -1;
                }
            }

            infiniteObjectManager = InfiniteObjectManager.instance;
        }
 public void Awake()
 {
     instance = this;
 }
        public override void Init()
        {
            base.Init();

            infiniteObjectManager = InfiniteObjectManager.instance;
        }
 public void Awake()
 {
     instance = this;
 }
        public override void Init()
        {
            base.Init();

            infiniteObjectManager = InfiniteObjectManager.instance;
        }