Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Passing arguments to Windows 10 Unity App by activating it with Cortana

Discussion in 'Windows' started by Notter, Nov 16, 2015.

  1. Notter

    Notter

    Joined:
    Mar 8, 2015
    Posts:
    65
    Hello,
    I'm trying to get my app to react to Cortana in Windows 10
    there's not much information around on this subject yet

    I've found a blog by Kevin Ashley that describes how to implement Cortana with unity, yet it's not explaining most things for when i want to customize the features.

    It covered how to activate commands with cortana when in-game.
    but what if i want to fire-up the game with an argument from cortana?

    is it possible to handle this event somehow and pass an argument to unity to i'll do certain things depending on what was spoken?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    Check the App.xaml.cs. There are several methods that can be called when application is launched, some have arguments. Making those available in Unity scripts is quite easy, as you can access classes from Unity scripts directly in there.
     
  3. Notter

    Notter

    Joined:
    Mar 8, 2015
    Posts:
    65
    Well, I'm gonna sounds ignorant..

    But how do i access the unity scripts from App.xaml.cs?
    also, won't App.xaml.cs be running even before my scripts have been created?

    any chance for a small example?
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
  5. Dinosaur

    Dinosaur

    Joined:
    Dec 13, 2012
    Posts:
    4