private void Calculate(ref Vector3Int result) { // failure // goal if (open.Count <= 0 || result != (Vector3Int.one * -1)) { return; } Vector3Int currentCell = open[0]; open.RemoveAt(0); closed.Add(currentCell); Vector3Int[] neighbours = mapIns.GetNeighboursRange1(currentCell); for (int i = 0; i < neighbours.Length; i++) { if (!agentNodeManager.IsHolding(neighbours[i])) { result = neighbours[i]; return; } open.Add(neighbours[i]); } Calculate(ref result); }
private void OnDeployButton() { if (agentWayPointManager.IsHolding (SyncData.CurrentMainBase.Position.Parse3Int().ToClientPosition())) { //Debugger.Log("Has a agent on base"); MessagePopup.Open("Has a agent on base"); return; } if (refTag != null && refTag.Slider.Value > 0) { Singleton.Instance <EventListenersController>().Emit("S_DEPLOY"); DecreaseQuality(); Close(); } }