private void OnTriggerEnter(Collider other) { if (other.tag == "WallEdge") { _wallEdge = other.gameObject.GetComponent <WallEdge>(); isTouchingWallEdge = true; } }
private void OnTriggerExit(Collider other) { if (other.tag == "WallEdge") { _wallEdge = null; isTouchingWallEdge = false; } }
private void OnTriggerEnter(Collider other) { if (other.tag == "Ground") { anim.SetBool("Jumping", false); audioSource.PlayOneShot(landing); jumping = false; gliding = false; holder1.SetActive(true); holder2.SetActive(false); } if (other.tag == "WallEdge") { currenteEdge = other.gameObject.GetComponent <WallEdge>(); touchingWallEdge = true; } if (other.tag == "Grind") { canGrind = true; } if (other.tag == "Water") { // anim.SetBool("Jumping", false); audioSource.Stop(); walkingOnWater = true; //jumping = false; //gliding = false; holder1.SetActive(true); holder2.SetActive(false); } if (other.tag == "Water40") { hp += 10; } if (other.tag == "Toldo") { noToldo = true; } if (other.tag == "Fim") { //SceneManager.LoadScene("SampleScene"); StartCoroutine(EndGame()); } }
private static ITile TransposeTile(ITile tile) { if (tile is Pit) return new Pit(); var originalFloorTile = (Floor) tile; Floor floorTile; if (tile is ExpressConveyer) floorTile = new ExpressConveyer(); else if (tile is Conveyer) floorTile = new Conveyer(); else if (tile is WrenchHammer) floorTile = new WrenchHammer(); else if (tile is Wrench) floorTile = new Wrench(); else if (tile is Gear) floorTile = new Gear((tile as Gear).Direction); else floorTile = new Floor(); foreach (var edge in originalFloorTile.Edges) { IEdge newEdge; if (edge.Item2 is WallLaserEdge) newEdge = new WallLaserEdge((edge.Item2 as WallLaserEdge).Lasers); else if (edge.Item2 is WallPusherEdge) newEdge = new WallPusherEdge((edge.Item2 as WallPusherEdge).Registers); else newEdge = new WallEdge(); floorTile.PutEdge(Utilities.GetOppositeOrientation(edge.Item1), newEdge); } var originalConveyer = originalFloorTile as Conveyer; if (originalConveyer != null) { var entrances = originalConveyer.Entrances.Select(Utilities.GetOppositeOrientation).ToList(); var newConveyer = (Conveyer) floorTile; newConveyer.Entrances = entrances; newConveyer.Exit = Utilities.GetOppositeOrientation(originalConveyer.Exit); } return floorTile; }