private void GenerateChunk(ChunkEnteredEvent e) { GameObject chunk = null; if (chunks == winAmountOfChunks) { chunk = (GameObject)Instantiate(winChunk); SpawnWinChunk(chunk); } else if (chunks < winAmountOfChunks) { int ran = Random.Range(0, chunkList.Count); int ran2 = Random.Range(0, 1); chunk = (GameObject)Instantiate(chunkList[ran]); //chunk = (GameObject)Instantiate (list [ran]); SpawnChunk(chunk); } else { ArrangeChunkList(); } }
private void YouHaveToAvoid(ChunkEnteredEvent e) { if (isTutorial && !haveToAvoid) { haveToAvoid = true; PlaySound("Play_MisVO16"); } }
/// <summary> /// Defines what the new target position is /// </summary> /// <param name="e">E.</param> public void PlayerProgression(ChunkEnteredEvent e) { if (numberOfPreviousChunks == -1) { EventManager.Instance.TriggerEvent(new PlayerHitsTheFirstRoadChunk()); gameStarted = true; ProgBar.SetActive(true); } ChunkScript script = e.chunk.GetComponent <ChunkScript>(); startPoint = script.StartPoint.transform.position; endPoint = script.EndPoint.transform.position; chunkLength = Vector3.Distance(startPoint, endPoint); numberOfPreviousChunks++; }
void MoveWithPlayer(ChunkEnteredEvent e) { moveTowardsPlayer = true; rotationDamping = 3.0f; }
private void StartTrack(ChunkEnteredEvent e) { movementController.StartTrack(); EventManager.Instance.StopListening <ChunkEnteredEvent>(StartTrack); }