Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

导出的C#行为树代码尝试调用Agent的internal方法导致跨项目编译失败 #137

Open
MysteryAngle opened this issue Aug 20, 2021 · 0 comments

Comments

@MysteryAngle
Copy link

Agent.cs有一个方法(1137):

internal VariableType GetVariable<VariableType>(uint variableId)

因为他是internal的,只能在单个项目中使用这个方法,因此导出的C#代码文件generated_behaviors.cs如果跟Agent不在同一个项目中的话,就会找不到这个方法,进而导致编译失败。

protected override EBTStatus update_impl(behaviac.Agent pAgent, behaviac.EBTStatus childStatus)
{
  Debug.Check(behaviac.Utils.MakeVariableId("_$local_task_param_$_0") == 2009726548u);
  string method_p1 = pAgent.GetVariable<string>(2009726548u); // 找不到方法,无法将参数uint转换为string
  ((MyAgent)pAgent).Goto(method_p0, method_p1);
  return EBTStatus.BT_SUCCESS;
}

我的项目中把behaviac运行时包装到了一个单独的项目中,其他项目依赖它,主要是为了拆分不用重新编译behaviac。

目前的解决办法是暂时将Agent的这个方法从internal改为了public。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant