示例#1
0
    // Use this for initialization
    void Start()
    {
        //get the instance of pedometer plugin
        pedometerPlugin = PedometerPlugin.GetInstance();

        //set to zero to hide debug toast messages
        pedometerPlugin.SetDebug(0);

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        //check if step detector is supported
        bool hasStepDetector = utilsPlugin.HasStepDetector();

        if (hasStepDetector)
        {
            UpdateStepDetectorStatus("available");

            //initialze pedometer
            pedometerPlugin.Init();

            //set this to true to always starts at zero steps, else set to false to continue steps
            pedometerPlugin.SetAlwaysStartAtZero(true);

            //set call back listener for pedometer events
            pedometerPlugin.SetCallbackListener(OnStepCount, OnStepDetect);

            //register sensor event listener and pass sensor delay that you want
            pedometerPlugin.RegisterSensorListener(SensorDelay.SENSOR_DELAY_FASTEST);
        }
        else
        {
            UpdateStepDetectorStatus("not available");
        }
    }
    // Use this for initialization
    void Start()
    {
        if (AndroidRuntimePermissions.CheckPermission("android.permission.RECORD_AUDIO") != AndroidRuntimePermissions.Permission.Granted)
        {
            AndroidRuntimePermissions.RequestPermission("android.permission.RECORD_AUDIO");
        }
        if (AndroidRuntimePermissions.CheckPermission("android.permission.ACCESS_FINE_LOCATION") != AndroidRuntimePermissions.Permission.Granted)
        {
            AndroidRuntimePermissions.RequestPermission("android.permission.ACCESS_FINE_LOCATION");
        }
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        // set the calling package this is optional
        // you can use this if your app is for children or kids
        speechPlugin.SetCallingPackage("com.mycoolcompany.mygame");

        AddSpeechPluginListener();
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        demoController = GameObject.FindObjectOfType<DemoController>();

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);
    }
示例#4
0
    // Use this for initialization
    void Start()
    {
        //get the instance of pedometer plugin
        pedometerPlugin = PedometerPlugin.GetInstance();

        //set to zero to hide debug toast messages
        pedometerPlugin.SetDebug(0);

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        //check if step detector is supported
        bool hasStepDetector = utilsPlugin.HasStepDetector();
        bool hasStepCounter  = utilsPlugin.HasStepCounter();

        //if (hasStepDetector) {
        if (hasStepCounter)
        {
            UpdateStepDetectorStatus("available");
            // event listeners
            AddEventListeners();
            //initialze pedometer
            pedometerPlugin.Init();
        }
        else
        {
            UpdateStepDetectorStatus("not available");
        }
    }
示例#5
0
    // Use this for initialization
    void Start()
    {
        demoController = GameObject.FindObjectOfType <DemoController>();

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);
    }
    private void Awake()
    {
#if UNITY_ANDROID
        if (Application.platform != RuntimePlatform.Android)
        {
            return;
        }

        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();
        textToSpeechPlugin.OnInit         += OnInit;
        textToSpeechPlugin.OnChangeLocale += OnSetLocale;
        textToSpeechPlugin.OnStartSpeech  += OnStartSpeech;
        textToSpeechPlugin.OnEndSpeech    += OnEndSpeech;
        textToSpeechPlugin.OnErrorSpeech  += OnErrorSpeech;
#endif
    }
示例#7
0
    void Start()
    {
        if (AndroidRuntimePermissions.CheckPermission("android.permission.RECORD_AUDIO") != AndroidRuntimePermissions.Permission.Granted)
        {
            AndroidRuntimePermissions.RequestPermission("android.permission.RECORD_AUDIO");
        }
        if (AndroidRuntimePermissions.CheckPermission("android.permission.WRITE_EXTERNAL_STORAGE") != AndroidRuntimePermissions.Permission.Granted)
        {
            AndroidRuntimePermissions.RequestPermission("android.permission.WRITE_EXTERNAL_STORAGE");
        }
        if (GameObject.FindGameObjectsWithTag("SceneThemeAudio").Length > 0)
        {
            sceneTheme = GameObject.FindGameObjectsWithTag("SceneThemeAudio")[0];
        }

        Bihou = GameObject.FindGameObjectWithTag("Bihou");

        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        // set the calling package this is optional
        // you can use this if your app is for children or kids
        speechPlugin.SetCallingPackage("com.mycoolcompany.mygame");

        AddSpeechPluginListener();
    }
示例#8
0
    // Use this for initialization
    void Start()
    {
        //get the instance of pedometer plugin
        pedometerPlugin = PedometerPlugin.GetInstance();

        //set to zero to hide debug toast messages
        pedometerPlugin.SetDebug(0);

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        //check if step detector is supported on the current android mobile device
        bool hasStepDetector = utilsPlugin.HasStepDetector();
        bool hasStepCounter  = utilsPlugin.HasStepCounter();

        //if (hasStepDetector) {
        if (hasStepCounter)
        {
            // yehey your android mobile device support pedometer

            UpdateStepDetectorStatus("available");
            // event listeners
            AddEventListeners();
            //initialze pedometer
            pedometerPlugin.Init();
        }
        else
        {
            // if you get this meaning
            // pedometer is not available on your android mobile device sorry!
            UpdateStepDetectorStatus("not available");
        }
    }
示例#9
0
    // Use this for initialization
    void Start()
    {
        timePlugin = TimePlugin.GetInstance();
        timePlugin.SetDebug(0);

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);
    }
示例#10
0
    // Use this for initialization
    void Start()
    {
        timePlugin = TimePlugin.GetInstance();
        timePlugin.SetDebug(0);

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);
    }
示例#11
0
    // Use this for initialization
    void Start()
    {
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        sharePlugin = SharePlugin.GetInstance();
        sharePlugin.SetDebug(0);
    }
示例#12
0
    // Use this for initialization
    void Start()
    {
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        sharePlugin = SharePlugin.GetInstance();
        sharePlugin.SetDebug(0);
    }
示例#13
0
    // Use this for initialization
    void Start()
    {
        appIndexingPlugin = AppIndexingPlugin.GetInstance();
        appIndexingPlugin.SetDebug(0);

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        InitGoogleIndexing();
    }
示例#14
0
    // Use this for initialization
    void Start()
    {
        appIndexingPlugin = AppIndexingPlugin.GetInstance();
        appIndexingPlugin.SetDebug(0);

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        InitGoogleIndexing();
    }
示例#15
0
    // Use this for initialization
    void Start()
    {
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);
        utilsPlugin.UnLockScreen();

        // dont sleep
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        ShowDemo(currentPage);
    }
示例#16
0
    private void Awake()
    {
        dispatcher = Dispatcher.GetInstance();

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        imagePickerPlugin = ImagePickerPlugin.GetInstance();
        imagePickerPlugin.SetDebug(0);
        // init image picker instance
        imagePickerPlugin.Init();
    }
示例#17
0
    private void Awake()
    {
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
    }
示例#18
0
    // Use this for initialization
    void Start()
    {
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        AddSpeechPluginListener();
    }
示例#19
0
    private void Awake()
    {
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();

        //textToSpeechPlugin.OnInit += this.OnInit;
        //textToSpeechPlugin.OnEndSpeech += this.OnEndSpeech;
    }
示例#20
0
    // Use this for initialization
    void Start()
    {
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        // set the calling package this is optional
        // you can use this if your app is for children or kids
        speechPlugin.SetCallingPackage("com.mycoolcompany.mygame");

        AddSpeechPluginListener();
    }
    // Use this for initialization
    void Start()
    {
        dispatcher = Dispatcher.GetInstance();

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        sharePlugin = SharePlugin.GetInstance();
        sharePlugin.SetDebug(0);

        imagePickerPlugin = ImagePickerPlugin.GetInstance();
        imagePickerPlugin.SetDebug(0);
        // init image picker instance
        imagePickerPlugin.Init();
        // add eventlisteners
        AddEventListener();

        EnableDisableShareButton(false);
    }
示例#22
0
    private void Awake()
    {
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();

        textToSpeechPlugin.OnInit         += OnInit;
        textToSpeechPlugin.OnChangeLocale += OnSetLocale;
        textToSpeechPlugin.OnStartSpeech  += OnStartSpeech;
        textToSpeechPlugin.OnEndSpeech    += OnEndSpeech;
        textToSpeechPlugin.OnErrorSpeech  += OnErrorSpeech;
    }
示例#23
0
    void Start()
    {
        dispatcher = Dispatcher.GetInstance();

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();

        AddSpeechPluginListener();
        AddTextToSpeechListener();

        apiaiClient = new ApiAiUnity();
        apiaiClient.Initialize(new AIConfiguration("a984bc306ae24d11b4105e251f892a21", SupportedLanguage.English));
    }