void OnTriggerEnter(Collider other) { if (CommonObjects.IsPlayer(other.gameObject)) { PlayEndOfGameSequence(); } }
void OnTriggerEnter(Collider otherCollider) { GameObject other = otherCollider.gameObject; //print("Collectible --> OnTriggerEnter: " + other.name); if (CommonObjects.IsPlayer(other)) { if (!MustBePurchased || Inventory.Instance.TrySpendRupees(price)) { Collect(); } } else { if (!MustBePurchased) { Weapon_Melee w = other.GetComponent <Weapon_Melee>(); if (w != null) { w.OnHitCollectible(this); } } } }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } if (dungeonRoom.IsDoorLocked(wallDirection)) { Inventory inv = CommonObjects.Player_C.Inventory; if (inv.HasItem("MagicKey")) { UnlockDoor(); } else if (inv.HasItem("Key")) { inv.UseItem("Key"); UnlockDoor(); } } if (dungeonRoom.CanPassThrough(wallDirection) || PlayerIsOnOuterSideOfDoor()) { SetPlayerWallCollisionEnabled(false); } }
void OnTriggerStay(Collider otherCollider) { if (!PushingEnabled) { return; } if (_isSliding || _hasFinishedSliding) { return; } GameObject other = otherCollider.gameObject; if (!CommonObjects.IsPlayer(other)) { return; } if (requiresPowerBracelet && !Inventory.Instance.HasItem("PowerBracelet")) { return; } Player player = CommonObjects.Player_C; IndexDirection2 dir = GetPushDirection(player); if (!dir.IsZero()) { Slide(dir); } }
void OnTriggerEnter(Collider other) { if (CommonObjects.IsPlayer(other.gameObject)) { OnHitPlayer(); } }
void OnTriggerEnter(Collider otherCollider) { GameObject other = otherCollider.gameObject; if (CommonObjects.IsPlayer(other)) { TakeControlOfLink(); } }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } subDungeon.OnPlayerEnteredPortal(this); }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } _lostSector.PlayerEnteredPortal(this); }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } Locations.Instance.WarpToOverworldDungeonEntrance(); }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } // TODO: Don't use SendMessage SendMessageUpwards("OnRupeeTriggerWasTriggered", this, SendMessageOptions.RequireReceiver); }
void OnTriggerEnter(Collider other) { if (CommonObjects.IsPlayer(other.gameObject)) { if (!CommonObjects.Player_C.IsAtFullHealth) { PlayRestorationSequence(); } } }
void OnTriggerEnter(Collider otherCollider) { GameObject other = otherCollider.gameObject; if (!CommonObjects.IsPlayer(other)) { return; } Music.Instance.PlayOverworld(); }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } CommonObjects.Player_C.PlayerGroundCollisionEnabled = true; Locations.Instance.WarpToDungeonEntranceStairs(dungeon); }
void OnTriggerExit(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } if (PlayerAtTopOfStairs()) { CommonObjects.Player_C.PlayerGroundCollisionEnabled = true; } }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } if (_isInStatueMode) { StartCoroutine("ComeAlive"); } }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } if (!PlayerHasRaft || PlayerIsOnRaft) { return; } TravelToDestination(); }
void OnTriggerEnter(Collider otherCollider) { GameObject other = otherCollider.gameObject; if (!CommonObjects.IsPlayer(other)) { return; } if (isIllusion) { PlaySecretSound(); } }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } CommonObjects.Player_C.PlayerGroundCollisionEnabled = false; if (Grotto != null) { Grotto.OnPlayerExit(); } }
void OnTriggerEnter(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } if (Grotto == null) { return; } CommonObjects.Player_C.PlayerGroundCollisionEnabled = true; Grotto.OnPlayerEnter(); }
void OnTriggerExit(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } if (!PlayerHasLadder) { return; } if (LadderBlock == this) { RemoveLadder(); } }
void OnTriggerExit(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } if (PlayerIsOnOuterSideOfDoor()) { CommonObjects.Player_C.IsInDungeonRoom = false; } else { CommonObjects.Player_C.IsInDungeonRoom = true; SetPlayerWallCollisionEnabled(true); } }
void OnTriggerExit(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } Vector3 playerPos = CommonObjects.Player_C.Position; if (Vector3.Distance(playerPos, dungeonRoom.Center) < ThresholdDist) { dungeonRoom.OnPlayerEnteredRoom(wallDirection); } else { dungeonRoom.onPlayerExitedRoom(); } }
virtual protected bool IsPlayerInLineOfSight(float maxDistance, Vector3 direction) { if (WorldInfo.Instance.IsInDungeon) { // We ensure Enemy is in the same DungeonRoom as Player DungeonRoom playerDR = DungeonRoom.GetRoomForPosition(Player.Position); if (_enemy.DungeonRoomRef != playerDR && playerDR != null) { return(false); } } LayerMask mask = Extensions.GetLayerMaskIncludingLayers(ZeldaLayers.LINK, ZeldaLayers.WALLS, ZeldaLayers.BLOCKS); RaycastHit hitInfo; bool didHit = Physics.Raycast(transform.position, direction, out hitInfo, maxDistance, mask); return(didHit ? CommonObjects.IsPlayer(hitInfo.collider.gameObject) : false); }
void OnTriggerEnterOrStay(Collider otherCollider) { if (!CommonObjects.IsPlayer(otherCollider.gameObject)) { return; } if (!PlayerHasLadder || LadderBlock != null) { return; } Player player = CommonObjects.Player_C; if (IsPlayerMovingTowardsThisBlock(player) && CanCross(player)) { Vector3 rot = DetermineLadderRotation(player); LayDownLadder(rot); } }