void OnTriggerExit(Collider other) { if (other.CompareTag("Player")) { AutomatedPlayerStealGem autoPlayerStealGem = other.GetComponent <AutomatedPlayerStealGem>(); autoPlayerStealGem.HideXIndicator(); this.gameObject.SetActive(false); } }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { AutomatedPlayerMovement autoPlayerMove = other.GetComponent <AutomatedPlayerMovement>(); AutomatedPlayerStealGem autoSealGem = other.GetComponent <AutomatedPlayerStealGem>(); autoPlayerMove.StopMove(); autoSealGem.ShowXIndicator(); autoPlayerMove.SetDirection(Vector3.left); autoPlayerMove.TurnDegrees(true, 90f); autoSealGem.StealGem(); autoPlayerMove.TurnDegrees(true, 180f); autoPlayerMove.SetDirection(Vector3.right); autoPlayerMove.StartMoveForward(); StartCoroutine(DelayAndTurn(autoPlayerMove)); this.backToBoatB4PlankTrigger.SetActive(true); this.backToBoatAfterPlankTrigger.SetActive(true); mainCamera.transform.position = secondCameraPosition.position; } }