Пример #1
0
    void Update()
    {
        if (SendPack)
        {
            _helloRequester.Continue();
        }
        else if (!SendPack)
        {
            _helloRequester.Pause();
        }

        ConditionsCheck();
    }
Пример #2
0
 private void OnPostRender()
 {
     if (SendPack)
     {
         Message send  = new Message(Globals.moveDir, Globals.reward, Globals.hasReachedGoal, Globals.rays, Globals.done, Globals.distanceToGoal, Globals.originalDistanceToGoal, false, Globals.goalCount);
         byte[]  array = Encoding.ASCII.GetBytes(JsonUtility.ToJson(send));
         _helloRequester.bytes = array;
         _helloRequester.Continue();
     }
     else if (!SendPack)
     {
         _helloRequester.Pause();
     }
 }
    void Update()
    {
        if (SendPack)
        {
            _helloRequester.messageToSend = playerInteract.pokenumber.ToString();



            _helloRequester.Continue();
        }
        else if (!SendPack)
        {
            _helloRequester.Pause();
        }
    }
Пример #4
0
    void Update()
    {
        if (SendPack)
        {
            // Here, the x and y position of the first seeker and the target character and the grid converted into a string are stored in a variable.

            positions = Mathf.CeilToInt(GameObject.Find("SeekerCharacter").transform.position.z) + "," + Mathf.CeilToInt(GameObject.Find("SeekerCharacter").transform.position.x) + ","
                        + Mathf.CeilToInt(GameObject.Find("TargetCharacter").transform.position.z) + "," + Mathf.CeilToInt(GameObject.Find("TargetCharacter").transform.position.x) + ","
                        + GameObject.Find("Grid").GetComponent <Grid>().convertedGrid;

            // The aforementioned variable is stored in 'messageToSend', so that the it can be sent in the 'HelloRequester' class.
            _helloRequester.messageToSend = positions;

            _helloRequester.Continue();
        }
        else if (!SendPack)
        {
            _helloRequester.Pause();
        }
    }
Пример #5
0
    void Update()
    {
        if (SendPack)
        {
            //The x and y coordinates of the first seeker (start position) and the target (end position)
            string startNodeCoordinates = Mathf.RoundToInt(seekerPosition.transform.position.z).ToString() + " " + Mathf.RoundToInt(seekerPosition.transform.position.x).ToString();

            string endNodeCoordinates = " " + Mathf.RoundToInt(targetPosition.transform.position.z).ToString() + " " + Mathf.RoundToInt(targetPosition.transform.position.x).ToString();

            //The grid tiles
            string gridArray = " " + GameObject.Find("AStar").GetComponent <GridPathFinding>().gridToArray;

            //The coordinates and grid are saved in a HelloRequester instance attribute
            _helloRequester.messageToSend = startNodeCoordinates + endNodeCoordinates + gridArray;

            _helloRequester.Continue();
        }
        else if (!SendPack)
        {
            _helloRequester.Pause();
        }
    }
Пример #6
0
 public void MessageToServer(string imagePath)
 {
     _helloRequester.imageMessage = imagePath;   //The image file path is saved in a HelloRequester instance attribute
     _helloRequester.Continue();
     _helloRequester.Pause();
 }
Пример #7
0
    //Dictionary<GameObject, string> map;

    public void SendObject(string msg)
    {
        _helloRequester.bytes = Encoding.ASCII.GetBytes(msg);
        _helloRequester.Continue();
    }