Exemplo n.º 1
0
    private void Start()
    {
        // retrieve objects from the scene
        _oscManager    = GameObject.Find("OscManager").GetComponent <OscManager>();
        _dronesManager = GameObject.Find("DronesManager").GetComponent <DronesManager>();

        Debug.Assert(_handDroneID >= 0, "hand drone ID not set");
        _handDrone = _dronesManager.GetDroneGameObjectById(_handDroneID);
        Debug.Assert(_bodyDroneID >= 0, "body drone ID not set");
        _bodyDrone = _dronesManager.GetDroneGameObjectById(_bodyDroneID);

        _dronesIds = new List <int>(_dronesManager
                                    .GetDrones()
                                    .Select(d_go => d_go.Id)
                                    .Where(id => id != _handDroneID && id != _bodyDroneID));

        // soft "emergency" : do not need to reboot the drone nor the server
        _handDrone.GetComponent <Drone>().UseAsInput = true;
        _bodyDrone.GetComponent <Drone>().UseAsInput = true;

        // Subscribe to the specktr OSC topic
        _oscManager.OscSubscribe(specktrOscTopic, this.onButtons);
    }
Exemplo n.º 2
0
 // utils
 public GameObject GetCurrentDrone()
 {
     return(_dronesManager.GetDroneGameObjectById(_dronesIds[_currentDroneIdx]));
 }