Exemplo n.º 1
0
    /// <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;
        }
    }
Exemplo n.º 2
0
 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>();
 }
Exemplo n.º 3
0
 void Awake()
 {
     if (!propPlacement)
     {
         propPlacement = FindObjectOfType <PropPlacement>();
     }
     if (!hexGrid)
     {
         hexGrid = FindObjectOfType <HexGrid>();
     }
 }
Exemplo n.º 4
0
    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;
    }
Exemplo n.º 5
0
 private void Start()
 {
     pPlace = FindObjectOfType <PropPlacement>();
 }