/// <summary> /// Sets the neighborIndex as the next goal location, and the direction you need to walk to get to it /// Sets all the flags and also hanndles data collection /// </summary> /// <param name="neighborIndex"></param> /// <param name="dir"></param> private void MoveTo(int neighborIndex, int dir, string tag) { int myFlag = 0; var nextLocation = currentLocation.GetNeighbor((HexDirection)((neighborIndex + 6) % 6)); //************************************** PropPlacement propPlacement = FindObjectOfType <PropPlacement>(); for (int i = 0; i < propPlacement.cards.Length; i++) { if (!propPlacement.cards[i].activeSelf) { if (propPlacement.cards[i].transform.position == nextLocation.transform.position) { myFlag = 1; } } } MainControl mainControl = FindObjectOfType <MainControl>(); if (myFlag == 1) { mainControl.updating_cards = true; } if (CanMove(nextLocation, dir) && turnController.CanMove(currentLocation.landType)) { transform.position = nextLocation.transform.position; currentLocation = nextLocation; } }
void OnEnable() { hexGrid = FindObjectOfType <HexGrid>(); propPlacement = FindObjectOfType <PropPlacement>(); startUIControl = FindObjectOfType <StartUIControl>(); setUpUIControl = FindObjectOfType <SetUpUIControl>(); turnController = FindObjectOfType <TurnController>(); cardGenerator = FindObjectOfType <CardGenerator>(); webSocketManager = FindObjectOfType <WebSocketManager>(); setGame = FindObjectOfType <SetGame>(); }
void Awake() { if (!propPlacement) { propPlacement = FindObjectOfType <PropPlacement>(); } if (!hexGrid) { hexGrid = FindObjectOfType <HexGrid>(); } }
void OnEnable() { infoGetter = FindObjectOfType <InformationGetter>(); // hexgrid = FindObjectOfType<HexGrid>(); turnController = FindObjectOfType <TurnController>(); commandCommunication = FindObjectOfType <CommandCommunication>(); propPlacement = FindObjectOfType <PropPlacement>(); startup = FindObjectOfType <Startup>(); InformationGetter.OnImageTakenEvent += GetSendImage; PropPlacement.OnMapCompleteEvent += SendMapCompleteMsg; PropPlacement.OnMapCompleteEvent += GetHandlers; HexQueuedCntrl.OnFinishedHexActionEvent += SendAgentInfo; QueuedControl.OnFinishedActionEvent += SendAgentInfo; }
private void Start() { pPlace = FindObjectOfType <PropPlacement>(); }