- Home /
Question by
mdsmith98 · Mar 15, 2018 at 06:07 AM ·
constructors
get_dataPath is not allowed to be called from a ScriptableObject constructor
I am using an asset called DarkPatcher from the asset store, which is basically a launcher/patching solution for games. I know it's best to probably contact the publisher, but this package is now deprecated, but I am still trying to use it if possible. Whenever I click branch manager for Dark Patcher, I get the following error:
get_dataPath is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'ProjectEditor'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEngine.Application:get_dataPath()
DarkPatcher.Unity.EditorPath:get_Path() (at Assets/Plugins/DarkPatcher/Scripts/DarkPatcher/EditorPath.cs:18)
DarkPatcher.Unity.EditorPath:get_FtpLoginPath() (at Assets/Plugins/DarkPatcher/Scripts/DarkPatcher/EditorPath.cs:100)
DarkPatcher.Unity.EditorPath:get_FtpLogin() (at Assets/Plugins/DarkPatcher/Scripts/DarkPatcher/EditorPath.cs:108)
DarkPatcher.UnityEditor.ProjectEditor:.ctor() (at Assets/Plugins/Editor/DarkPatcher/Scripts/DarkPatcher/ProjectEditor.cs:100)
UnityEngine.ScriptableObject:CreateInstance()
DarkPatcher.UnityEditor.ProjectEditor:Open(String) (at Assets/Plugins/Editor/DarkPatcher/Scripts/DarkPatcher/ProjectEditor.cs:122)
DarkPatcher.UnityEditor.BranchManager:OnGUI() (at Assets/Plugins/Editor/DarkPatcher/Scripts/DarkPatcher/BranchManager.cs:68)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Here is the code it is referring to:
namespace DarkPatcher.Unity
{
public static class EditorPath
{
public static string Path
{
get
{
return Application.dataPath.Replace("Assets", "DarkPatcher");
}
}
I know there are other patching solutions out there, but I really liked DarkPatcher, and would like to continue using it if this issue is easily fixable. If not, then I guess I will need to try to use a different asset. Thanks!
Comment