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 override void OnInspectorGUI() { base.OnInspectorGUI(); SectionSelection sectionSelection = (SectionSelection)target; if (sectionSelection.sectionSelectionType == SectionSelectionType.None) { return; } bool probabilityType = false; if (sectionSelection.sectionSelectionType == SectionSelectionType.ProbabilityRandom || sectionSelection.sectionSelectionType == SectionSelectionType.ProbabilityLoop) { GUILayout.Label("Active Sections", "BoldLabel"); int start = EditorGUILayout.IntField("Start Section", sectionSelection.startSection); if (start != sectionSelection.startSection) { sectionSelection.startSection = start; } int end = EditorGUILayout.IntField("End Section", sectionSelection.endSection); if (end != sectionSelection.endSection) { sectionSelection.endSection = end; } probabilityType = true; } GUILayout.Label(string.Format("Section Change {0}", probabilityType ? "Probability" : ""), "BoldLabel"); DistanceValueList sectionList = sectionSelection.sectionList; if (DistanceValueListInspector.ShowLoopToggle(ref sectionList, probabilityType ? DistanceValueType.Probability : DistanceValueType.Section)) { sectionSelection.sectionList = sectionList; EditorUtility.SetDirty(target); } DistanceValueListInspector.ShowDistanceValues(ref sectionList, probabilityType ? DistanceValueType.Probability : DistanceValueType.Section); if (DistanceValueListInspector.ShowAddNewValue(ref sectionList, probabilityType ? DistanceValueType.Probability : DistanceValueType.Section)) { sectionSelection.sectionList = sectionList; EditorUtility.SetDirty(target); } }
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 Awake() { instance = this; }
public void Awake() { instance = this; }