public JObject ScanControllers()
        {
            JObject response = new JObject();

            //Controller Serial Number
            //Number Of controllers
            List <WGController> controllers = WGController.ScanNet(Properties.Settings.Default.controllerPort);

            if (controllers == null)
            {
                response["message"] = "No controllers Found";
                return(response);
            }

            response["message"] = $"{controllers.Count} controllers found";


            List <ControllerScanResponse> scanResults = new List <ControllerScanResponse>();


            foreach (WGController c in controllers)
            {
                scanResults.Add(new ControllerScanResponse(c.Connection.ID, 4));
            }

            response["controllers"] = JToken.FromObject(scanResults);

            return(response);
        }
 // Start is called before the first frame update
 void Start()
 {
     controller          = GetComponent <WGController>();
     aiPath              = GetComponent <AIPath>();
     aiDestinationSetter = GetComponent <AIDestinationSetter>();
     seeker              = GetComponent <Seeker>();
 }
Beispiel #3
0
        //TODO: Add Support For NonStandard Port Selection
        public JObject SearchControllers()
        {
            JObject response = new JObject();

            //Controller Serial Number
            //Number Of Controllers
            List <WGController> controllers = WGController.ScanNet(Properties.Settings.Default.controllerPort);

            if (controllers == null)
            {
                response.Add(new JProperty("message", "No controllers Found"));
                response.Add(new JProperty("controllers", null));
                return(response);
            }

            response.Add(new JProperty("message", $"{controllers.Count} controllers found"));
            List <UInt16> serialNumbers = new List <UInt16>();

            foreach (WGController c in controllers)
            {
                serialNumbers.Add(c.Connection.ID);
            }

            response.Add(new JProperty("controllers", serialNumbers));
            return(response);
        }
Beispiel #4
0
    void Awake()
    {
        Instance = this;


//        float size = _mainCamera.orthographicSize;
//
//        SDK.Log("width===="+Screen.width+";height===="+Screen.height);
//
//        float factor = Screen.width*1.0f/Screen.height;
//        if(factor<0.6667f)
//        {
//            _mainCamera.orthographicSize = size*1f;
//        }
//        else{
//            _mainCamera.orthographicSize = size*0.85f;
//        }
//
//        SDK.Log("width===="+Screen.width+";height===="+Screen.height);
    }
 // Start is called before the first frame update
 void Start()
 {
     controller        = GetComponent <WGController>();;
     bannerInteraction = GetComponent <BannerInteraction>();
 }