Example #1
0
    void Start()
    {
        _startButton = gameObject.GetComponentInChildren <Button>();
        _startButton.onClick.AddListener(ToggleProcessing);
        _locationStates = gameObject.GetComponentsInChildren <Image>().Where(i => i.name != "ToggleListeningButton").ToArray();

        try
        {
            _rhinoManager = RhinoManager.Create(_contextPath, OnInferenceResult);
        }
        catch (Exception ex)
        {
            Debug.LogError("RhinoManager was unable to initialize: " + ex.ToString());
        }
    }
Example #2
0
 void Start()
 {
     _startButton = gameObject.GetComponentInChildren<Button>();
     _startButton.onClick.AddListener(ToggleProcessing);
     _locationStates = gameObject.GetComponentsInChildren<Image>().Where(i => i.name != "ToggleListeningButton").ToArray();
     _errorMessage = gameObject.transform.Find("ErrorMessage").GetComponent<Text>();
     
     try
     {
         _rhinoManager = RhinoManager.Create(ACCESS_KEY, _contextPath, OnInferenceResult, processErrorCallback: ErrorCallback);
     }
     catch (RhinoInvalidArgumentException ex)
     {
         SetError($"{ex.Message}\nMake sure your access key '{ACCESS_KEY}' is a valid access key.");
     }
     catch (RhinoActivationException)
     {
         SetError("AccessKey activation error");
     }
     catch (RhinoActivationLimitException)
     {
         SetError("AccessKey reached its device limit");
     }
     catch (RhinoActivationRefusedException)
     {
         SetError("AccessKey refused");
     }
     catch (RhinoActivationThrottledException)
     {
         SetError("AccessKey has been throttled");
     }
     catch (RhinoException ex)
     {
         SetError("RhinoManager was unable to initialize: " + ex.Message);
     }
 }