从 Boo 脚本导入其他脚本
我在从 boo 脚本引用 Unity 项目中的其他脚本时遇到问题。例如,SendMessage 是我在其他地方创建的 MonoBehavior,执行以下操作:
import UnityEngine
class MissionIcon (SendMessage):
def Start ():
pass
def Update ():
pass
抛出“名称 SendMessage 不表示有效类型(未找到)。 添加
import SendMessage
抛出“未找到命名空间 SendMessage”,添加
import SendMessage from Scripts.GUI.menus
(我的脚本位于 Assets/Scripts/GUI/menus 下)抱怨这不是程序集,并且添加
import SendMessage from "Scripts/GUI/menus"
说同样的事情。那么..我该怎么做呢?感谢并抱歉这个问题的全部内容
I'm having trouble referencing other scripts in my unity project from boo scripts. For example, SendMessage is a MonoBehavior I created elsewhere, doing this:
import UnityEngine
class MissionIcon (SendMessage):
def Start ():
pass
def Update ():
pass
throws a "The name SendMessage does not denote a valid type (not found).
adding an
import SendMessage
throws a "Namespace SendMessage not found", adding
import SendMessage from Scripts.GUI.menus
(my script is under Assets/Scripts/GUI/menus) complains that that's not an assembly, and adding
import SendMessage from "Scripts/GUI/menus"
says the same thing. So.. how do I do this? Thanks and sorry about the total n00bness of the question
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为,您必须像任何其他统一资产一样导入脚本。
查看 http://unity3d.com/support/documentation/Manual /Asset%20Import%20and%20Creation.html
I think, you have to import script as any other unity asset.
Look at http://unity3d.com/support/documentation/Manual/Asset%20Import%20and%20Creation.html
AFAIK boo 无法导入脚本文件。
您应该导入所需的命名空间并将引用的文件添加到 booc。
像这样的东西:
AFAIK boo can't import script files.
You should import required namespace and add referenced file to booc.
Something like: