public List <BoundingBox> GetListOfDisplacementAreas() { List <BoundingBox> resultList = new List <BoundingBox> (); Room currentRoom = GetCurrentRoom(); if (currentRoom != null) { List <GraphTransition> outGoingTransitions = currentRoom.GetOutgoingTransitions(); foreach (GraphTransition currentTransition in outGoingTransitions) { if (!IsTransitionEventReady(currentTransition)) { continue; } if ((currentTransition.GetTransitionType() == TRANSITION_TYPE.CLIC_AREA_TYPE) || (currentTransition.GetTransitionType() == TRANSITION_TYPE.BACK_TRANSITION)) { AreaClicTransition currentClicTransition = (AreaClicTransition)currentTransition; BoundingBox currentTransitionBB = currentClicTransition.GetRelativeBoundingBox(); resultList.Add(currentTransitionBB); } } } return(resultList); }
public bool ClicToMove(float x, float y) { Room currentRoom = GetCurrentRoom(); if (currentRoom != null) { List <GraphTransition> outGoingTransitions = currentRoom.GetOutgoingTransitions(); foreach (GraphTransition currentTransition in outGoingTransitions) { if (!IsTransitionEventReady(currentTransition)) { continue; } if ((currentTransition.GetTransitionType() == TRANSITION_TYPE.CLIC_AREA_TYPE) || (currentTransition.GetTransitionType() == TRANSITION_TYPE.BACK_TRANSITION)) { AreaClicTransition currentClicTransition = (AreaClicTransition)currentTransition; BoundingBox currentTransitionBB = currentClicTransition.GetRelativeBoundingBox(); if ((x >= currentTransitionBB.x1) && (x <= currentTransitionBB.x2) && (y >= currentTransitionBB.y1) && (y <= currentTransitionBB.y2)) { if (currentTransition.GetTransitionType() == TRANSITION_TYPE.CLIC_AREA_TYPE) { m_roomsPile.Add((Room)m_token); FireTransition(currentTransition); m_roomChangeShouldBeImmediate = currentClicTransition.IsImmediate(); } else { if (m_roomsPile.Count > 0) { Room roomToGoBack = m_roomsPile [m_roomsPile.Count - 1]; m_roomsPile.RemoveAt(m_roomsPile.Count - 1); TeleportToRoom(roomToGoBack); //GenericLog.Log ("AH AHHHHH"); } } return(true); } //BoundingBox transitionBB = currentClicTransition. } } } return(false); }