fantomPlugin_ReadMe_en.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. http://fantom1x.blog130.fc2.com/blog-entry-293.html
  2. Android Native Dialogs and Functions Plugin
  3. Setup & Build Manual
  4. ・Native Plugin "fantomPlugin.aar" is required 'Minimum API Level:Android 4.2 (API 17)' or higher.
  5. (*) It is necessary to set it to 'Android 4.4 (API 19)' or higher in order to use 'StorageLoadTextController' and 'StorageSaveTextController' to read/write text file of storage.
  6. (*) In order to acquire the value of the sensor it is necessary to set it above the necessary API Level of each sensor. For details, refer to official document or comments such as sensor related method & constant values.
  7. https://developer.android.com/reference/android/hardware/Sensor.html#TYPE_ACCELEROMETER
  8. ・Move the "Assets/FantomPlugin/Plugins/" folder just under "Assets/" like "Assets/Plugins/". This "Plugins" folder is a special folder for running the plugin at runtime.
  9. (see) https://docs.unity3d.com/Manual/ScriptCompileOrderFolders.html
  10. ・Rename "AndroidManifest-FullPlugin~.xml" to "AndroidManifest.xml" when receive events of Hardware Volume buttons, Speech Recognizer with dialog, open Wifi Settings, request Bluetooth enable, read/write text file on External Storage, open Gallery, register MediaScanner, acquire change event of screen rotation, acquire sensor values, confirm Device Credentials (authentication), acquire text from QR Code Scanner.
  11. ・Depending on the function you use, Android permission is required (https://developer.android.com/guide/topics/security/permissions.html). Permission is summarized in "Assets/Plugins/Android/Permission_ReadMe.txt". Please copy the necessary permission to "AndroidManifest.xml" (It is better to delete the permission of functions not used).
  12. ・Text To Speech is required the reading engine and voice data must be installed on the smartphone.
  13. (see) http://fantom1x.blog130.fc2.com/blog-entry-275.html#fantomPlugin_TextToSpeech_install
  14. (Voice data: Google Play)
  15. https://play.google.com/store/apps/details?id=com.google.android.tts
  16. https://play.google.com/store/apps/details?id=jp.kddilabs.n2tts (Japanese)
  17. ・To use QR code reading, QR code scanner application of ZXing (google's open source project) must be installed on the device. If it is not installed, you will be prompted to install (it will be directed to Google Play).
  18. (Google Play)
  19. https://play.google.com/store/apps/details?id=com.google.zxing.client.android
  20. (ZXing open source project)
  21. https://github.com/zxing/zxing
  22. ・Select "_Landscape", "_Portrait" or "_Sensor" of "AndroidManifest~.xml" according to the screen rotation attribute (screenOrientation) of the application.
  23. (see) https://developer.android.com/guide/topics/manifest/activity-element.html#screen
  24. (*) Warning "Unable to find unity activity in manifest. You need to make sure orientation attribute is set to sensorPortrait manually." can be ignored if you use anything other than Unity standard Activity (UnityPlayerActivity).
  25. (see) https://docs.unity3d.com/ja/current/Manual/AndroidUnityPlayerActivity.html
  26. ------------------------------------------------
  27. ■About demo
  28. ・Rename "AndroidManifest_demo.xml" to "AndroidManifest.xml" when building the Demo. Also add the scene in "Assets/FantomPlugin/Demo/Scenes/" to 'Build Settings...' and switch to 'Android' with 'Switch Platform'.
  29. ・For Unity 2018.1.0 to 1.6, please build "Build System" as "Internal".
  30. (*) In the build of Unity 2018.1.0 to 1.6, when "Build Settings" is set to "Gradle" in "Build Settings ...", it is known that the package name is not added to "AndroidManifest.xml", and a build error occurs (Unity2018.1.7 and later have been bugfixed). In that case, you can build by describing 'package="(package name of application)"' (= Edit> Project Settings> Player> Other Settings> Identification> Package Name) in the "manifest" tag of "AndroidManifest.xml" (Until Unity 2017.4.2 is added automatically).
  31. http://fantom1x.blog130.fc2.com/#unity2018_CommandInvokationFailure_packageName
  32. ・The toggle button "Job" (C# Job System) of "CpuTest" is available in Unity 2018.1.0 or higher.
  33. (*) The demo of 'GalleryPickTest' does not include the mesh of the whole sphere (360 degrees). If necessary, download 'Sphere100.fbx' from the following URL and set it to 'Sphere' of hierarchy 'GalleryPickTest (Script)'. Also, please set 'TextureMat' to the material of 'Sphere 100'. Because the whole sphere look from the inside, if you give a negative value to the scale X, you can invert the image (size as you like, Scale Factor of mesh=1000 x Scale of Transform=-1 in the demo video). Please refer to the following article for the setup method.
  34. (360 degrees [whole shphere] setup)
  35. http://fantom1x.blog130.fc2.com/blog-entry-297.html
  36. (Mesh of whole sphere: Sphere100.fbx)
  37. http://warapuri.com/post/131599525953/
  38. (Demo video: Vimeo)
  39. https://vimeo.com/255712215
  40. -> Plug-in demo "FantomPluginDemo_QR.png" (QR code) contains an example of setup. Please also check the operation.
  41. ------------------------------------------------
  42. ■Application example
  43. ・This Plug-in functions are also used for the following applications that are actually released.
  44. If you want to check the operation please download it from AmazonAppStore (Cardboard VR, free App).
  45. UnityChan Flyer (Free)
  46. http://amzn.to/2xJ4ujS
  47. SapphiartChan Live Show! (Free)
  48. http://amzn.to/2xKmZ7H
  49. [*] Outside of Japanese-speaking countries, it will be localized in English automatically.
  50. In particular,
  51. 1. Operation hardware volume control (including Bluetooth operation) → Using 'HardVolumeController'.
  52. 2. Long Press (including Bluetooth operation) to Re-center (viewpoint reset) → Using 'LongKeyInput'.
  53. 3. Display battery information → Use 'BatteryStatusController'.
  54. 4. Language localization (switching between English and Japanese) → Using 'LocalizeString', 'LocalizeStringResource', 'LocalizeText'.
  55. etc...
  56. ●You can also download a simple sample app on blog (from GoogleDrive).
  57. ・UnityChan In OtakuCity (UnityChan will fly over Akihabara!)
  58. http://fantom1x.blog130.fc2.com/blog-entry-289.html#UnityChanInOtackuityAndroid
  59. This is a demonstration of "EasyMusicPlayer" (simple music player, storage access function, custom dialog etc), "SmoothFollow3" (camera angle operation with fingers), "PinchInput" (pinch operation), "SwipeInput" (swipe operation). It is also becoming a coin collection game. The compatible device will be Android 4.2 or higher (you need to allow "Install application with unknown provider").
  60. ・UnityChan Voice Janken (UnityChan Speech Recognition Janken) [*Japanese only]
  61. http://fantom1x.blog130.fc2.com/blog-entry-273.html#UnityChanVoiceJanken
  62. It is a voice recognition scissors game. The compatible device will be Android 4.2 or higher (you need to allow "Install application with unknown provider").
  63. ・FantomPluginDemo_QR.png (QR code)
  64. You can download the demo that you built the latest version of the plugin with apk. An example of setting up some dummy objects on the scene is also included. Please also check the operation (QR code -> Google Drive to DL). The compatible device will be Android 4.2 or higher (you need to allow "Install application with unknown provider").
  65. ------------------------------------------------
  66. ■News!
  67. The music library including sample song is now on sale at the Asset Store!
  68. Seamless Loop and Short Music (FREE!)
  69. https://www.assetstore.unity3d.com/#!/content/107732
  70. ------------------------------------------------
  71. ■Update history
  72. (ver.1.1)
  73. ・Added PinchInput, SwipeInput, LongClickInput/LongClickEventTrigger and its demo scene (PinchSwipeTest).
  74. ・Added SmoothFollow3 (originally StandardAssets SmoothFollow) with right/left rotation angle, height and distance, and added a corresponding to pinch (PinchInput) and swipe (SwipeInput) (demo scene: used with PinchSwipeTest).
  75. ・Changed the color format conversion of 'XColor' from ColorUtility to calculation formulas(Mathf.RoundToInt()).
  76. ・Changed 'XDebug' option of lines limit.
  77. (ver.1.2)
  78. ・Added prefab and '-Controller' script of all functions.
  79. ・Added value change callbacks to SingleChoiceDialog, MultiChoiceDialog, SwitchDialog and CustomDialog items.
  80. ・Fixed bug that XDebug's automatic newline flag (newline) was ignored. Also, cleared the text buffer (Queue) with OnDestory() when using line limit.
  81. (ver.1.3)
  82. ・Added function to open WIFI system settings (WifiSettingController).
  83. ・Added function to make Bluetooth connection request (dialog display) (BluetoothSettingController).
  84. ・Added function to send text using Chooser application (simple text sharing function) (SendTextController).
  85. ・Added functions to read/write text files (StorageLoadTextController/StorageSaveTextController) using the Storage Access Framework (API 19 or higher).
  86. ・Added function to open the gallery application and get the path of the image file (GalleryPickController) (also load texture and save screenshot).
  87. ・Added function to register (scan) file path to MediaScanner (MediaScannerController).
  88. (ver.1.4)
  89. ・Added function to vibrate the Vibrator (VibratorController).
  90. ・Added vibrator function to notification (NotificationController).
  91. ・Changed all extended editor scripts with 'SerializedProperty' (as the setting was sometimes not saved in the editor).
  92. (ver.1.5)
  93. ・Added function to get (listening) status of battery temperature, health(overheat, good, etc.), remaining capacity, connection status (BatteryStatusController).
  94. (ver.1.6)
  95. ・Added function to get (listening) change status of device orientation (OrientationStatusController).
  96. ・Added function to get (listening) sensor values (~SensorController).
  97. (ver.1.7)
  98. ・Added prefabs and demo to open various system settings screen.
  99. ・Added 'ActionType.ActionOnly' constant(enum) and 'Action' input support function to 'AndroidActionController'.
  100. ・Added some special ActionControllers such as 'MailerController', 'DialerController', 'ApplicationDetailsSettingsController' and etc.
  101. (ver.1.8)
  102. ・Added function to use device credentials (authentication) [*fingerprint, pattern, PIN, password, etc. depending on user setting].
  103. ・Added function to get API Level (int type) of the running device.
  104. (ver.1.9)
  105. ・Added function to check permission granted (AndroidPlugin.CheckPermission(), ~Controller.IsPermissionGranted).
  106. ・Added support check (IsSupported~) and permission granted check (IsPermissionGranted) to several "~Controller"[*1] at startup (Start()). When it is not possible, an error message is returned to 'OnError' callback.
  107. [*1]SpeechRecognizerDialogController, BluetoothSettingController, SpeechRecognizerController, VibratorController, HeartRateController, All other sensors (IsSupportedSensor only).
  108. (ver.1.10)
  109. ・Added function to launch QR Code (Bar Code) Scanner and acquire text (ShowQRCodeScanner()).
  110. ・Added general constants of sensor values (SensorConstant).
  111. (ver.1.11)
  112. ・Added multiple parameter overload to StartAction(), StartActionWithChooser(), StartActionURI(). 'AndroidActionController' also supports multiple parameters.
  113. ・Changed 'MailerController' to multiple parameter actions (because more mailers can handle it).
  114. ・Added Market (Google Play) search function (MarketSearchController).
  115. ・Added function to acquire application installation check (IsExistApplication()), application name (GetApplicationName()), application version number (GetVersionCode()), application version name (GetVersionName()).
  116. (ver.1.12)
  117. ・Added function (LocalizeStringResource) to manage resource localization data by ID.
  118. ・Introduced the string localization (LocalizeString) in the dialog, etc. ID field was added for resource management, and some specifications were changed [*2] to correspond to the resource management function.
  119. ・Added controller for application installation check (AppInstallCheckController).・Added a permission check controller (PermissionCheckController).
  120. ・Add long key press (Back key etc.) input judgment script (LongKeyInput) (added to PinchSwipeTest demo).
  121. [*2]Change language search to 'system language -> default setting language' only. In order to ignore the localization (= existing as it is) when the device language can not be found. Also change the font size default to 0 (= existing as it is) (* It does not change in the example of demo use, but please be careful if you are writing your own script.) Default language setting properly If so, the behavior does not change).
  122. (ver.1.13)
  123. ・Added function to attach images to text send (SendTextController) and mailer (MailerController).
  124. ・Screen shot part only create a library (Screenshot) independently from demo (※ old demo remains as it is).
  125. ・Added editor tools insert/remove items, ID duplication, empty check editor tool in LocalizeStringResource (on inspector).
  126. ・Added 'LocalizeString' argument overload to the dynamic text setting method of some controllers.
  127. ・Added function to change localization language (LocalizeLanguageChanger).
  128. ・Added function to change language locale to speech recognization (SpeechRecognizerController, SpeechRecognizeDialogrController) and text reading (TextToSpeechController).
  129. (ver.1.14)
  130. ・Added cancel callback to 'SingleChoiceDailogController', 'MultiChoiceDialogController', 'SliderDialogController', 'SwitchDialogController', 'CustomDialogController'.
  131. ・Changed when cancel button was pressed with 'VolumeSliderDialogController', the volume was modified to return to before change.
  132. ・Added checkbox (CheckItem) to the item type of the Custom Dialog.
  133. ・Added voltage to battery information (atteryInfo.voltage).
  134. ・Fixed 'LocalizeString.FontSizeByLanguage()' language search to 'system language -> default language' (to match 'LocalizeString.TextByLanguage()').
  135. ・Added simple language display switching function for confirming editor to 'LocalizeLanguageChanger' (.debugLanguage, .debugApplyOnStart).
  136. ・Changed the equal interval arrangement tool such as UI (ObjectArrangeTool) [support tool] to a reorderable list, and also added function to drag & drop and parallel move of position.
  137. (ver.1.15)
  138. ・Added function (GalleyPickController) so that you can also get movie information (path etc) from the gallery.
  139. ・Added "size" (file size), "mimeType" (MIME Type) and "orientation" (rotation angle) fields to ImageInfo (image information acquisition class).
  140. (ver.1.16)
  141. ・Added function to acquire image, audio, video, other file and folder information with the Storage Access Framework (StorageOpenImageController, StorageOpenAudioController, StorageOpenVideoController, StorageOpenFileController, StorageOpenFolderControlle).
  142. ・Added function of save file (write access) by the Storage Access Framework (StorageSaveFileController).
  143. ・"UriWithMimeType" (action to URI with MIME type designation) added to AndroidActionController. And also added a demonstration to open various files to ExternalStorageTest as a sample.
  144. ・Added simple music player sample script (EasyMusicPlayer) and demo scene (MusicPlayerExample).
  145. (ver.1.17)
  146. ・Added function to request permission (+ show explanation of the rationale dialog). Added "requestWhenNotGranted" option to 'PermissionCheckController'.
  147. ・Change sensor's support check function to real time (no cache) with sensor controller base script 'SensorControllerBase'.
  148. (ver.1.18)
  149. ・Added status acquisition function of CPU utilization (CpuRateController). Also added a script "CpuRateBar" (single CPU) which displays the CPU utilization as a bar and "CpuRateBarView" (multiple CPUs) to display in a list.
  150. ・Added script "FpsText.cs" to display FPS (Frame Per Second) on UI-Text. Also added that prefab "FpsMonitor".
  151. ・Add "XGizmo" to display simple gizmos of sphere, box, line, mesh.
  152. ・Added field (targetText) to read and write directly to UI-Text to StorageLoadTextController and StorageSaveTextController.
  153. ・Added CurrentIndex and IsPlaying properties to EasyMusicPlayer.
  154. ・The storage open function when EasyMusicPlayer's song was added was included in the same class (it can be added directly from the previous StorageOpenAudio Controller).
  155. ・Change the item "Use Name" in "Scene Specification" and "Scene Name / Scene Build Index" in 'SceneLoadWithKey' Inspector (internally keeping the bool value).
  156. ・Fixed invalid code paths other than Android platform (not affected when building with Android).
  157. (*)The latest version can be downloaded from GoogleDrive on blog (*Japanese version only).
  158. http://fantom1x.blog130.fc2.com/blog-entry-273.html
  159. ------------------------------------------------
  160. ■License of use library. etc
  161. This plugin includes deliverables distributed under the license of Apache License, Version 2.0.
  162. http://www.apache.org/licenses/LICENSE-2.0
  163. ZXing ("Zebra Crossing") open source project (google). [ver.3.3.2] (QR Code Scan)
  164. https://github.com/zxing/zxing
  165. ------------------------------------------------
  166. Let's enjoy creative life!
  167. By Fantom
  168. [Blog] http://fantom1x.blog130.fc2.com/
  169. [Unity Connect] https://connect.unity.com/u/5abd008032b30600256e8ca9
  170. [Twitter] https://twitter.com/fantom_1x
  171. [SoundCloud] https://soundcloud.com/user-751508071
  172. [Picotune] http://picotune.me/?@Fantom
  173. [Monappy] https://monappy.jp/u/Fantom
  174. [E-Mail] fantom_1x@yahoo.co.jp