文档

Development

User Acquisition

Monetization

工业

Cloud Code

Open Unity Dashboard

Cloud Code

此页面不支持所选语言。
Cloud Code
​
​
Cloud Code 3.0.0 experimental features
  • Overview
  • Stateful Cloud Code
  • Local Cloud Code server
  • Develop Cloud Code modules in the Unity Editor
  • State serialization in Cloud Code
  • Timers in Stateful Cloud Code
  1. Cloud Code
  2. Cloud Code 3.0.0 experimental features

Develop Cloud Code modules in the Unity Editor

Author Cloud Code modules (.ccmu) entirely within the Unity Editor.
阅读时间3 分钟
最后更新于 2 个月前

重要
This page describes an experimental feature that might change significantly before release. It's not recommended to use or rely on experimental features in production environments due to potential instability.
You can create, compile, and deploy Cloud Code modules entirely within the Unity Editor. A module created in this way is called a Unity Cloud Code module (UCCM), and its asset file carries the .ccmu extension.
UCCMs bring the entire module workflow into the Editor, automating some processes and improving iteration time. The same logic and concepts of the legacy Cloud Code modules still apply, with the following additional key features:
  • Develop Cloud Code modules using the standard Unity Editor script workflow. Scripts are created and compiled directly in the Editor, but their contents are edited in your currently configured External Script Editor.
  • Unity Cloud Code modules compile automatically during the standard Editor compilation pass, without having to manually generate bindings.
  • Debugging is built-in by default and integrated into the Editor.

Create a Unity Cloud Code module

You can create a new UCCM directly within the Unity Editor.
To create a Unity Cloud Code module:
  1. In the Project window, select or create a folder to contain your module.
  2. Right-click in the folder, then select Create > Services > Cloud Code Module Script. The Cloud Code Script appears in your folder.
  3. Optionally rename the script, then press Enter to accept the script.
  4. In the Cloud Code Module Creator dialog that opens, select the Cloud tab, where you can do the following:
    • In the Cloud Code Script field, optionally rename the C# script.
    • In the Cloud Code C# Module field, optionally rename the module.
  5. Verify the remaining paths and file names for the other resources in the Cloud and Client tabs.
  6. Select Confirm.
  7. If required, repeat steps 1 to 3 to create another script. Creating a script in the same folder automatically adds it to the module.
The module now appears in the Deployment window as a Cloud Code Module. From the Deployment window, you can deploy the module to a remote server or to a local Cloud Code server if you have one running.
提示
When testing Stateful Cloud Code on a local server, you can reset persistent states directly from within the Cloud Code Toolbar button to return your game to its default state.
The previous procedure generates the following:
  • A
    Cloud
    folder containing a Cloud Code script and an Assembly Definition. Write your module logic here. You can add more scripts to this folder.
  • A
    Client
    folder containing a client script and an Assembly Definition. This client script is an empty partial class containing a reference to a generated file that's updated automatically from your Cloud Code scripts.
  • A Unity Cloud Code module asset (.ccmu) in the parent folder, pointing to both Assembly Definitions. Use this file to deploy the module in the Deployment window.
警告
The Client classes are partial classes because Cloud Code uses source generation to create client-side bindings for your game to call cloud functions. Because the Client script is automatically generated, don't modify it directly, as doing so can break your game.

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。

  • 在本页上
    • Create a Unity Cloud Code module

  • 其他资源
  • Cloud Code modules
  • Deployment window
  • Organizing scripts into assemblies

报告此页面的问题
​
​