Пример #1
0
    // Use this for initialization
    void Start()
    {
        manager = PhotonManager.Instance;
        manager.Start();
        GameObject obj = GameObject.Find("/Canvas/Button");

        obj.GetComponent <Button> ().enabled = false;
    }
        // Refresh photons managed by the PhotonManager
        private void RefreshManagerPhotons()
        {
            _manager.Stop();

            Photon dummy;

            while (!_manager.Photons.IsEmpty)
            {
                _manager.Photons.TryTake(out dummy);
            }

            foreach (string photonKey in DictPhoton.Keys)
            {
                _manager.AddPhoton(DictPhoton[photonKey].IP, DictPhoton[photonKey].Port);
            }

            if (_acquisitionState == AcquisitionState.On)
            {
                _manager.Start();
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            if (!File.Exists("./dataset.csv"))
            {
                File.Create("./dataset.csv").Close();
            }

            _fileWriter = new StreamWriter(new FileStream("./dataset.csv", FileMode.Truncate));
            _fileWriter.WriteLine("ULTRASOUND_1;ULTRASOUND_2;ULTRASOUND_3;ULTRASOUND_4;ULTRASOUND_5;sensor");
            using (PhotonManager manager = new PhotonManager())
            {
                manager.DataReceived += ManagerDataReceived;
                manager.AddPhoton("172.24.24.113", 8888);

                manager.Start();
                Console.WriteLine("Press enter to quit");
                Console.ReadLine();
                manager.Stop();
            }
        }