Application.platform == RuntimePlatform.Android

eagleeyez 4 years ago updated by Lazlo Bonin (Lead Developer) 4 years ago 4

Application.platform == RuntimePlatform.Android

  Hi, In Playmaker I use the following script below to access my SD card on Android. How do I find this Application.Platform in Ludig? Or do I have to install something else? I have JDK and SDK setup in Unity.

using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
public class findSdcard : MonoBehaviour {
    public string GetAndroidInternalFilesDir()
        string[] potentialDirectories = new string[]
        if (Application.platform == RuntimePlatform.Android)
            for (int i = 0; i < potentialDirectories.Length; i++)
                if (Directory.Exists(potentialDirectories[i]))
                    return potentialDirectories[i];
        return "";

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Did you go into Ludiq Properties and add Application as a type? You'll also need to add RuntimePlatform as well if it isn't.

Oh Thanks. I did, but I added the wrong one. Now I've got the right one and it works.

Many thanks


This is what I got in Bolt just using debug to show the false or true when on Android. Thanks again.