简体   繁体   English

如何在 Unity 3d 中使用用 C# 或 Java 开发的 GUI

[英]How to use a GUI developed with C# or Java in Unity 3d

I have beginned to learn Unity 3d.我已经开始学习Unity 3d。 And I know, there are GUI-Components build in in Unity 3d.而且我知道,Unity 3d 中内置了 GUI 组件。

But I want to developed an "external" GUI with C# or Java, and use this GUI to change the parameter such as "speed" "position" and so on.但是我想用C#或Java开发一个“外部”GUI,并使用这个GUI来改变“速度”“位置”等参数。 How can I integrate the GUI into a Unity 3d project?如何将 GUI 集成到 Unity 3d 项目中? Is that possible?那可能吗?

With best regards and thanks for your answer.向您致以最诚挚的问候并感谢您的回答。

You can create a powerful GUI in Unity5 now, which uses C# or javascript in the background.您现在可以在 Unity5 中创建一个强大的 GUI,它在后台使用 C# 或 javascript。

Here is a link to some tutorials to get you started, however it is not like their old GUI system.这里是一些教程的链接,可以帮助您入门,但它不像他们旧的 GUI 系统。

Unity uses its own GUI system/UI system, there are a lot of tutorials online how to use it. Unity使用自己的GUI系统/UI系统,网上有很多教程如何使用。

Yes it is possible to use C# to change the GUI while the game is running.是的,可以在游戏运行时使用 C# 更改 GUI。

One thing that you want to keep in mind is when you create a script that will need to use the UI namespace.您要记住的一件事是,当您创建需要使用 UI 命名空间的脚本时。

That means that at the top of the script you have to put: using UnityEngine.UI;这意味着您必须在脚本的顶部放置: using UnityEngine.UI; . . some good tutorial links:一些不错的教程链接:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM