Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

getfolderpath help

Discussion in 'Scripting' started by witcher101, Oct 11, 2016.

  1. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    I am using webplayer and function " GetFolderPath" is not avialable
    I am getting an error in this line
    uiAnimationsFolderPath=FileHelper.GetFolderPath("UI")+"/Presets/UIAnimations/";

    Is there a way to fix this in unity webplayer??
    Thanks
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,139
    What is your error?
    Webplayer is also going out the door, so there isn't going to be much support for it anymore.
     
  3. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    DoozyUI.FileHelper' does not contain a definition for `GetFolderPath' is the error
     
  4. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    The class FileHelper in the namespace DoozyUI doesn't have a method named GetFolderPath. You're trying to use a method that doesn't exist.
     
  5. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    but it works in webgl so why not webplayer??
     
  6. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    Sounds like you need to ask whoever wrote DoozyUI :)
     
  7. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,139
    It's possible that they have tags such as
    #if UNITY_WEBGL
    #endif

    for example around certain methods. These methods would only be valid for certain build targets.
    https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
    Explains a little bit about it. If they use these tags, that means it would work for webgl only but not for webplayer.
     
  8. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    Given the name of the method I'm assuming it uses some System.IO stuff in which case it's probably wrapped in
    Code (csharp):
    1.  
    2. #if !UNITY_WEBPLAYER
    3.  
    because IO isn't supported on that platform.