// Update is called once per frame //private void Update() //{ //} //Start the action to Android public void StartAction() { #if UNITY_EDITOR Debug.Log("AndroidActionControlloer.StartAction called"); #elif UNITY_ANDROID switch (actionType) { case ActionType.ActionOnly: if (addExtras.Length > 0) { string[] names; string[] values; GetAddExtrasArrays(out names, out values); AndroidPlugin.StartAction(action, names, values); } else { AndroidPlugin.StartAction(action); } break; case ActionType.URI: if (addExtras.Length > 0) { string[] names; string[] values; GetAddExtrasArrays(out names, out values); AndroidPlugin.StartActionURI(action, uri, names, values); } else { AndroidPlugin.StartActionURI(action, uri); } break; case ActionType.ExtraQuery: if (addExtras.Length > 0) { string[] names; string[] values; GetAddExtrasArrays(out names, out values, extra, query); AndroidPlugin.StartAction(action, names, values); } else { AndroidPlugin.StartAction(action, extra, query); } break; case ActionType.Chooser: if (addExtras.Length > 0) { string[] names; string[] values; GetAddExtrasArrays(out names, out values, extra, query); AndroidPlugin.StartActionWithChooser(action, names, values, mimetype, title); } else { AndroidPlugin.StartActionWithChooser(action, extra, query, mimetype, title); } break; } #endif }
public void MakeVibrationOnBPM() { AndroidPlugin.StartVibrator(30); }
// Update is called once per frame //private void Update() //{ //} //Show Notification public void Show() { #if UNITY_EDITOR Debug.Log("NotificationController.Show called"); #elif UNITY_ANDROID switch (tapAction) { case TapAction.BackToApplication: if (vibratorType == VibratorType.OneShot) { AndroidPlugin.ShowNotification( title, message, string.IsNullOrEmpty(iconName) ? "app_icon" : iconName, idTag, showTimestamp, mVibratorDuration); //Converted to a long type. } else { AndroidPlugin.ShowNotification( title, message, string.IsNullOrEmpty(iconName) ? "app_icon" : iconName, idTag, showTimestamp, mVibratorPattern); //Converted to a long type. } break; case TapAction.OpenURL: if (string.IsNullOrEmpty(url)) { return; } if (vibratorType == VibratorType.OneShot) { AndroidPlugin.ShowNotificationToActionURI( title, message, string.IsNullOrEmpty(iconName) ? "app_icon" : iconName, idTag, "android.intent.action.VIEW", url, showTimestamp, mVibratorDuration); //Converted to a long type. } else { AndroidPlugin.ShowNotificationToActionURI( title, message, string.IsNullOrEmpty(iconName) ? "app_icon" : iconName, idTag, "android.intent.action.VIEW", url, showTimestamp, mVibratorPattern); //Converted to a long type. } break; } #endif }
int apiLevel = 0; //0: (not set) // Use this for initialization private void Start() { #if !UNITY_EDITOR && UNITY_ANDROID apiLevel = AndroidPlugin.GetAPILevel(); #endif }
void Awake() { instance = this; }