コード例 #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));
                }
            }
        }
    }
コード例 #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();
    }
コード例 #3
0
 private void Awake()
 {
     // get the car controller
     m_Car          = GetComponent <CarController>();
     helloRequester = new HelloRequester();
     InvokeRepeating("send", 0f, 0.2f);
 }
コード例 #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();
    }
コード例 #5
0
    private void Start()
    {
        _helloRequester = new HelloRequester();
        _helloRequester.Start();

        _helloRequester.box = box.GetComponent <Magic>();
        _helloRequester.run = run;
    }
コード例 #6
0
 private void Start()
 {
     instructionsText = GameObject.Find("InstructionText").GetComponent <TextMeshProUGUI>();
     _helloRequester  = new HelloRequester();
     //brick.GetComponent<BrickChanger>();
     _helloRequester.Start();
     _helloRequester.stepNumber = 0;
 }
コード例 #7
0
ファイル: HelloClient.cs プロジェクト: LorchZachery/499
 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);
 }
コード例 #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();
    }
コード例 #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;
    }
コード例 #10
0
ファイル: HelloClient.cs プロジェクト: rajs1006/3D-Unity
 private void Start()
 {
     _helloRequester = new HelloRequester();
     _helloRequester.Start();
 }
コード例 #11
0
 private void Start()
 {
     _helloRequester = new HelloRequester();
     Debug.Log("HelloClientNormal");
     _helloRequester.Start();
 }
コード例 #12
0
 private void Start()
 {
     stopConnect.onClick.AddListener(stopConnectFun);
     startConnect.onClick.AddListener(startConnectFun);
     _helloRequester = new HelloRequester();
 }
コード例 #13
0
 public void Start()
 {
     _helloRequester = new HelloRequester();
     _helloRequester.Start();
 }
コード例 #14
0
 private void Start()
 {
     _helloRequester           = new HelloRequester();
     _helloRequester.callback += onMessage;
     _helloRequester.Start();
 }
コード例 #15
0
 private void Start()
 {
     helloRequester = new HelloRequester();
     InvokeRepeating("send", 0f, 0.1f);
 }
コード例 #16
0
ファイル: HelloClient.cs プロジェクト: karthiks1701/TIESTO
 private void Start()
 {
     _helloRequester = new HelloRequester();//trafficLightAI);
     _helloRequester.Start();
 }