public void ReceiveQuadrantRequestRPC(string id, PhotonMessageInfo info) { Debug.LogError("ReceiveQuadrantRequest " + id); Quadrant quadrant = root.FindQuadrantByID(id); // Exit if no quadrant found if (quadrant == null) { Debug.LogWarning("No quadrant found of id " + id); return; } SendQuadrant(quadrant, info.Sender); }
public Quadrant FindQuadrantByID(string id) { if (this.id == id) { return(this); } else { string subId = id.Substring(0, this.id.Length + 1); if (bottomLeft != null && bottomLeft.IdStartsWithSubId(subId)) { return(bottomLeft.FindQuadrantByID(id)); } if (bottomRight != null && bottomRight.IdStartsWithSubId(subId)) { return(bottomRight.FindQuadrantByID(id)); } if (topLeft != null && topLeft.IdStartsWithSubId(subId)) { return(topLeft.FindQuadrantByID(id)); } if (topRight != null && topRight.IdStartsWithSubId(subId)) { return(topRight.FindQuadrantByID(id)); } } return(null); }