Ejemplo n.º 1
0
    void Start()
    {
        //cam = gameObject.GetComponent<Camera>();
        cam = GameObject.FindGameObjectWithTag("getScreen").GetComponent <Camera>();

        // "train.bat" for training
        // "play.bat" for play
        System.Diagnostics.Process.Start("play.bat");

        //StartCoroutine(wait());
        System.Threading.Thread.Sleep(10000);

        resetImg();
        Time.captureFramerate = 10;
        rb2d = GetComponent <Rigidbody2D>();

        _helloRequester = new HelloRequester();
        _helloRequester.Start();

        spawnPoints = new List <Vector3>();

        for (int x = -19; x < tp.size.x; x++)         // tilemap i sonuna kadar dolaş spawnlanabileceği tüm noktaları spawnpoints'e ata
        {
            for (int y = -15; y < tp.size.y; y++)
            {
                Vector3Int virtualtilepos = new Vector3Int(x, y, 0);
                Vector3    realtilepos    = tp.CellToWorld(virtualtilepos);
                Tile       tile           = (Tile)tp.GetTile(virtualtilepos);
                if (tile != null)
                {
                    spawnPoints.Add(new Vector3(realtilepos.x + .5f, realtilepos.y + .5f, realtilepos.z));
                }
            }
        }
    }
Ejemplo n.º 2
0
    IEnumerator TakePhoto()  // Start this Coroutine on some button click
    {
        // NOTE - you almost certainly have to do this here:

        yield return(new WaitForEndOfFrame());


        Texture2D photo = new Texture2D(webCamTexture.width, webCamTexture.height);

        photo.SetPixels(webCamTexture.GetPixels());
        photo.Apply();

        //Encode to a PNG
        photoBytes = photo.EncodeToPNG();
        Debug.Log(photoBytes);
        //Write out the PNG. Of course you have to substitute your_path for something sensible
        //File.WriteAllBytes("photo.png", photoBytes);
        Debug.Log("Photu taken");

        sendReq();

        //yield return new WaitForSeconds(4);

        //OnDestroy();
        _helloRequester = new HelloRequester();
    }
Ejemplo n.º 3
0
 private void Awake()
 {
     // get the car controller
     m_Car          = GetComponent <CarController>();
     helloRequester = new HelloRequester();
     InvokeRepeating("send", 0f, 0.2f);
 }
Ejemplo n.º 4
0
    private void Start()
    {
        _helloRequester = new HelloRequester();

        webCamTexture = new WebCamTexture();
        GetComponent <Renderer>().material.mainTexture = webCamTexture; //Add Mesh Renderer to the GameObject to which this script is attached to
        webCamTexture.Play();
    }
    private void Start()
    {
        _helloRequester = new HelloRequester();
        _helloRequester.Start();

        _helloRequester.box = box.GetComponent <Magic>();
        _helloRequester.run = run;
    }
Ejemplo n.º 6
0
 private void Start()
 {
     instructionsText = GameObject.Find("InstructionText").GetComponent <TextMeshProUGUI>();
     _helloRequester  = new HelloRequester();
     //brick.GetComponent<BrickChanger>();
     _helloRequester.Start();
     _helloRequester.stepNumber = 0;
 }
Ejemplo n.º 7
0
 private void Start()
 {
     webcamTexture = new WebCamTexture();
     webcamTexture.Play();
     data = new Color32[webcamTexture.width * webcamTexture.height];
     Debug.Log("height " + webcamTexture.width + "width" + webcamTexture.height);
     _helloRequester = new HelloRequester();
     webcamTexture.GetPixels32(data);
     _helloRequester.Start(data, webcamTexture.width, webcamTexture.height);
 }
Ejemplo n.º 8
0
    void startConnectFun()
    {
        this.GetComponent <WriteLocation>().saveRoom();
        if (_helloRequester.Running)
        {
            _helloRequester.Stop();
        }
        _helloRequester                 = new HelloRequester();
        Status.text                     = _helloRequester.status;
        _helloRequester.serverIP        = ipInput.text;
        _helloRequester.sendFilePath    = this.GetComponent <RoomManager>().inputFilePath;
        _helloRequester.receiveFilePath = this.GetComponent <RoomManager>().outputFilePath; // change this to your directory

        _helloRequester.fileName = room;
        _helloRequester.Start();
    }
Ejemplo n.º 9
0
    private void Start()
    {
        //map = new Dictionary<GameObject, string>();
        targets   = new List <GameObject>();
        targetsID = new List <int>();
        agents    = GameObject.FindObjectsOfType <GoapAgent>();
        var supplyPiles = FindObjectsOfType <SupplyPileComponent>();
        var rocks       = FindObjectsOfType <IronRockComponent>();
        var forges      = FindObjectsOfType <ForgeComponent>();
        var trees       = FindObjectsOfType <TreeComponent>();
        var chopBlocks  = FindObjectsOfType <ChoppingBlockComponent>();

        foreach (var item in supplyPiles)
        {
            targets.Add(item.gameObject);
        }
        foreach (var item in rocks)
        {
            targets.Add(item.gameObject);
        }
        foreach (var item in trees)
        {
            targets.Add(item.gameObject);
        }
        foreach (var item in forges)
        {
            targets.Add(item.gameObject);
        }
        foreach (var item in chopBlocks)
        {
            targets.Add(item.gameObject);
        }

        foreach (var item in targets)
        {
            targetsID.Add(item.GetInstanceID());
        }

        _helloRequester = new HelloRequester();
        _helloRequester.Start();
        _helloRequester.msgEvent += ProcessMessage;
    }
Ejemplo n.º 10
0
 private void Start()
 {
     _helloRequester = new HelloRequester();
     _helloRequester.Start();
 }
 private void Start()
 {
     _helloRequester = new HelloRequester();
     Debug.Log("HelloClientNormal");
     _helloRequester.Start();
 }
Ejemplo n.º 12
0
 private void Start()
 {
     stopConnect.onClick.AddListener(stopConnectFun);
     startConnect.onClick.AddListener(startConnectFun);
     _helloRequester = new HelloRequester();
 }
Ejemplo n.º 13
0
 public void Start()
 {
     _helloRequester = new HelloRequester();
     _helloRequester.Start();
 }
Ejemplo n.º 14
0
 private void Start()
 {
     _helloRequester           = new HelloRequester();
     _helloRequester.callback += onMessage;
     _helloRequester.Start();
 }
Ejemplo n.º 15
0
 private void Start()
 {
     helloRequester = new HelloRequester();
     InvokeRepeating("send", 0f, 0.1f);
 }
Ejemplo n.º 16
0
 private void Start()
 {
     _helloRequester = new HelloRequester();//trafficLightAI);
     _helloRequester.Start();
 }