void OnTriggerEnter2D(Collider2D col) { if (col.gameObject.tag == "pipe" || col.gameObject.tag == "pipeblank") { FloorManagerScript.RemovePipe(col.transform.parent.gameObject); } }
void OnTriggerEnter2D(Collider2D col) { if (col.gameObject.tag == "ground") { FloorManagerScript.UpdateFloor(); } }
// Use this for initialization void Start() { listOfStartPos[0] = GameObject.Find("PlayerStart1").transform.position; listOfStartPos[1] = GameObject.Find("PlayerStart2").transform.position; listOfStartPos[2] = GameObject.Find("PlayerStart3").transform.position; listOfStartPos[3] = GameObject.Find("PlayerStart4").transform.position; listOfStartPos[4] = GameObject.Find("PlayerStart5").transform.position; //Gets the starting index from the menu selection in previous menu scene. startPosIndex = CalculateStartPos(timeKeeps.startingPositionFromMenu); //Initially places the camera in the correct spot camFollow.SetInitialCamera(startPosIndex); //Calculates which level the player has selected in the menu and starts them in the right spot. player.transform.position = listOfStartPos[startPosIndex]; //Lets the time keeping script to know what zone and level is being timed. zoneManager.levelID = startPosIndex; zoneManager.UpdateZoneID(); gameManagerScript = gameObject.GetComponent <GameManagerScript>(); if (SceneManager.GetActiveScene().name == "Zone3") { floorManage = GameObject.Find("Floor Manager").GetComponent <FloorManagerScript>(); isZone3 = true; floorManage.levelTraps[0].SetActive(false); floorManage.levelTraps[1].SetActive(false); floorManage.levelTraps[2].SetActive(false); floorManage.levelTraps[3].SetActive(false); floorManage.levelTraps[4].SetActive(false); floorManage.levelTraps[startPosIndex].SetActive(true); } else { floorManage = null; } }