Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public class Check : MonoBehaviour {
- Text TextCheck;
- void Start () {
- TextCheck = GameObject.Find ("TextCheck").GetComponent<Text>();
- }
- public void ButtonClick(){
- if (Application.platform == RuntimePlatform.Android)
- TextCheck.text = "Android";
- else {
- if (Application.platform == RuntimePlatform.WP8Player)
- TextCheck.text = "WP8Player";
- else {
- if (Application.platform == RuntimePlatform.WindowsPlayer)
- TextCheck.text = "WindowsPlayer";
- else
- TextCheck.text = "Khong Biet";
- }
- }
- }
- void OnEnable ()
- {
- btnCall.onClick.AddListener (() => tryCall ());
- }
- void Disable ()
- {
- btnCall.onClick.RemoveListener (() => tryCall ());
- }
- private void tryCall ()
- {
- /*
- AndroidJNIHelper.debug = true;
- #if UNITY_ANDROID && !UNITY_EDITOR
- AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
- AndroidJavaObject jo = jc.GetStatic("currentActivity");
- textField.text = jo.Call("getCacheDir").Call("getCanonicalPath");
- #endif
- */
- }
- public Button btnCall;
- public InputField textField;
- private AndroidJavaObject jo;
- }
Advertisement
Add Comment
Please, Sign In to add comment