protected override void Execute(CodeActivityContext context) { var deviceID = (int)DeviceID.Get(context); var dynamicEnergyThreshold = (Boolean)DynamicEnergyThreshold.Get(context); var energyThresholdValue = (Int32)EnergyThresholdValue.Get(context); if (energyThresholdValue <= 0) { energyThresholdValue = 300; } var pauseThreshold = PauseThreshold.Get(context); if (pauseThreshold <= 0) { pauseThreshold = 0.8; } double?timeoutSeconds = TimeoutSeconds.Get(context); double?phraseTimeLimit = PhraseTimeLimit.Get(context); var inputLanguage = InputLanguage.Get(context); if (inputLanguage.Length < 2) { inputLanguage = "en-US"; } var apiKey = APIKey.Get(context); var username = Username.Get(context); var password = Password.Get(context); var engine = Engine; var filePath = FilePath.Get(context); IEnumerable <object> inputParameters = new object [] { deviceID, filePath, inputLanguage, apiKey, username, password, engine, dynamicEnergyThreshold, energyThresholdValue, pauseThreshold, timeoutSeconds, phraseTimeLimit }; OutputParameters.Set(context, inputParameters); }
void GetPhysicalAddress() { #if UNITY_EDITOR physicalAddress = "test"; #else physicalAddress = DeviceID.Get(); #endif }
private string getDeviceID() { if (deviceID == "") { deviceID = StringUtil.Base64Encode(DeviceID.Get()); } Debug.Log("deviceId:" + deviceID); return(deviceID); }
// [DllImport("__Internal")] // private static extern string GetIphoneADID(); public static string getMacAdd() { // #if UNITY_ANDROID // deviceId = SystemInfo.deviceUniqueIdentifier; // #elif UNITY_IPHONE // deviceId = "IOS-" + GetIphoneADID(); // #endif // if (Application.platform == RuntimePlatform.IPhonePlayer) { // //deviceId = Device.advertisingIdentifier; // if (deviceId == "") { // NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces(); // string mac = ""; // foreach (NetworkInterface ni in nis) { // mac = ni.GetPhysicalAddress ().ToString (); // if (mac != "") { // deviceId = NetUtil.Base64Encode(mac); // break; // } // // mac = mac + "-" + ni.GetPhysicalAddress ().ToString (); // // Debug.Log ("Name = " + ni.Name); // // Debug.Log ("Des = " + ni.Description); // // Debug.Log ("Type = " + ni.NetworkInterfaceType.ToString() ); // // Debug.Log ("Mac地址 = " + ni.GetPhysicalAddress().ToString() ); // // Debug.Log ("------------------------------------------------"); // } // } // } // else { // deviceId = SystemInfo.deviceUniqueIdentifier; // } deviceId = DeviceID.Get(); Debug.Log("deviceId:" + deviceId); //return NetUtil.Base64Encode(deviceId); return(StringUtil.Base64Encode(deviceId)); }