了解 Auki 网络和代币经济的基本原理
在 Auki 网络的支持下,获取自己的领域。
深入了解Auki网络白皮书的细节
在Uniswap DEX上交易$AUKI
在MEXC CEX上交易$AUKI
在Aerodrome DEX上交易$AUKI
实时跟踪 Auki 网络的网络状况。
See how the Auki network is empowering robot fleets.
See how the Auki network is enabling AI.
See how the Auki network is enabling XR experiences.
使用ConjureKit,构建第一代社交增强现实体验。
申请高达 100,000 美元 Auki 代币的开发者补助金
了解如何在 posemesh 上使用我们的 SDK 构建应用程序。
所有 ConjureKit SDK 文档和支援。
了解 Cactus 如何提高零售效率。
了解 Gotu 如何协助物业经理工作。
了解 Gotu 导航如何提升您的活动体验。
零售行业的空间人工智能平台。
为活动和物业提供室内导航。
家庭和展览装饰应用。
通过这个同时多人共享的AR体验,让您大获全胜。
看看谁在与Auki一起搭建 posemesh。
深入了解我们的理念。
加入 Discord 对话。
通过 X 随时了解 Auki 社区的最新动态。
Stay up to date with the Auki community on X.
关于 Auki 和 posemesh 的常见问题。
我们的新闻稿、媒体资料工具包和联系方式。
In order for all participants in the session to see the same color changes, we'll show a simple implementation of ECS.
After finishing the previous tutorials, you should have a project where users can join a shared AR session, create a primitive cube, and change the color of the cube by touching it with their hand, using Ur (hand tracker module). All the participants can see the cubes that other people created but will only see the color updates on the cubes touched by them. To change that, we will create a new component that will store the color data in the session and a system that will add and update the components and keep the color data locally. When a participant touches a cube, the color will be updated locally on that participant's device and a message will be broadcast to all other participants with the new color data.
Let's start by creating a color component and a color system.
Create a new ^ColorSystem^ C# class that inherits from ^SystemBase^. ConjureKit will invoke the abstract methods defined in ^SystemBase^.
ColorSystem^
SystemBase^
public class ColorSystem : SystemBase { public ColorSystem(Session session) : base(session) { } }
Declare a new component name.
// The unique name of the component private const string COLOR_COMPONENT_NAME = "color";
And override the abstract method of SystemBase - ^GetComponentTypeNames^ to return the color component. This method is called by ConjureKit during initialization. The system is notified when components of the type reported by this method are updated or removed.
GetComponentTypeNames^
public override string[] GetComponentTypeNames() { return new[] {COLOR_COMPONENT_NAME}; }
To get a list of all components that other participants have updated, let's create an override method for The SystemBase Update method, ConjureKit invokes this method when the Hagall server broadcasts a component update. Using this method, we will update a local map of component data and trigger an event for each update.
So let's declare the map of component data as a Dictionary :
// Local Color component data map private readonly IDictionary<uint, Color> _entityColorDataMap = new Dictionary<uint, Color>();
And the event we want to trigger on every update.
/// Triggered when a component data is updated by another participant public event Action<uint, Color> OnColorComponentUpdated;
And finally, let's override the Update method.
public override void Update(IReadOnlyList<(EntityComponent component, bool localChange)> updated) { foreach (var (entityComponent, localChange) in updated) { // Update the local data and notify about the update _entityColorDataMap[entityComponent.EntityId] = ByteArrayToColor(entityComponent.Data); OnColorComponentUpdated?.Invoke(entityComponent.EntityId, _entityColorDataMap[entityComponent.EntityId]); } }
申请 AUKI 代币补助金以启动您的项目,并直接与 Auki Labs 团队合作,将您的创意推向市场。成功申请者可获得价值高达 10 万美元的 AUKI 代币,以及 Auki Labs 团队提供的开发和营销支持。