Tools.GetOS C# (CSharp) Method

GetOS() public static method

public static GetOS ( ) : string
return string
    public static string GetOS()
    {
#if UNITY_STANDALONE
        return "Win";
#elif UNITY_ANDROID
        return "Android";
#elif UNITY_IPHONE
        return "iOS";
#endif
    }

Usage Example

Example #1
0
    private string GetRealAssetPath(string abName)
    {
        if (abName.Equals(Tools.GetOS()))
        {
            return(abName);
        }
        abName = abName.ToLower();
        if (!abName.EndsWith(GameSetting.ExtName))
        {
            abName += GameSetting.ExtName;
        }
        if (abName.Contains("/"))
        {
            return(abName);
        }

        if (mAssetBundleManifest == null)
        {
            return(null);
        }

        string[] paths = mAssetBundleManifest.GetAllAssetBundles();
        for (int i = 0; i < paths.Length; i++)
        {
            int    index = paths[i].LastIndexOf('/');
            string path  = paths[i].Remove(0, index + 1);

            if (path.Equals(abName))
            {
                return(paths[i]);
            }
        }
        Debug.LogError("GetRealAssetPath Error:>>" + abName);
        return(null);
    }
All Usage Examples Of Tools::GetOS