了解 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 this first part of the lesson, we'll download an existing single player AR game to use as the starting point and implement the Auki SDK.
For the purpose of this tutorial, we have created a repository that you can use as a starting point for the project. All features of the gameplay have been implemented in single player mode. The repository commits have been tagged to mark the states of the project according to the sections of this tutorial.
To get started, pull the project from GitHub and check out the "Initial project setup" commit:
git clone git@github.com:aukilabs/ConjureKit-Shooter-Game.git cd ConjureKit-Shooter-Game git checkout 07d285316bc8d4626ba444172be70bffa6cb679a
Upon opening the project in Unity, there will be an error message asking you to enter Safe Mode; you can safely ignore this. The cause of the error is the project's dependency on a couple of assets that are available for free in the Unity asset store. In order to fix this, please import these two assets:
Once the above assets are imported (note: don't forget to go through the quick setup process for DOTween), you should be able to play and test the game. If you want to try it in the Editor, you can press Alpha 1 to toggle mouse control, in order to emulate first person control for easier editor testing.
The project can also be built to a device without any additional changes to settings. Please refer to the relevant device-platform deployment documentation. You will see a "Missing Project ID" dialog, but you can click "Yes" to continue.
In this part, we'll start implementing the Auki SDK (previously called ConjureKit) into the project, and listen to some of the callbacks. The packages we need should already be installed in the project pulled from GitHub, but if you need to, please refer to the Quickstart guide for instructions on how to set up the SDK.
start-note
Please also make sure the Managed Stripping Level is set to Minimal, under Project Settings > Player > Optimization.
end-note
First let's add the necessary packages to ^Main.cs^:
Main.cs^
using Auki.ConjureKit; using Auki.ConjureKit.Manna; using Auki.ConjureKit.Vikja; using Auki.Integration.ARFoundation.Manna; using Auki.Util;
Then we'll declare the fields that will hold references to ConjureKit and its modules:
private IConjureKit _conjureKit; private Vikja _vikja; private Manna _manna; private FrameFeederBase _arCameraFrameFeeder;
These two fields will keep track of the session and its current state:
private State _currentState; private Session _session;
Next we want to construct/initialize all the ConjureKit modules. We can do that in the ^Start()^ method of ^Main.cs^:
Start()^
private void Start() { Screen.sleepTimeout = SleepTimeout.NeverSleep; _conjureKit = new ConjureKit(arCamera.transform, "YOUR_APP_KEY", "YOUR_APP_SECRET", AukiDebug.LogLevel.ERROR); _manna = new Manna(_conjureKit); _vikja = new Vikja(_conjureKit); _arCameraFrameFeeder = _manna.GetOrCreateFrameFeederComponent(); _arCameraFrameFeeder.AttachMannaInstance(_manna); EventInit();
_conjureKit.Connect(); }
start-warning
Make sure you replace ^YOUR_APP_KEY^ and ^YOUR_APP_SECRET^ with the values you got during registration.
YOUR_APP_KEY^
YOUR_APP_SECRET^
end-warning
Now let's create ^EventInit()^ in which we'll subscribe all the methods (that we'll declare shortly) to their respective events from ConjureKit:
EventInit()^
private void EventInit() { _conjureKit.OnJoined += OnJoined; _conjureKit.OnLeft += OnLeft; _conjureKit.OnParticipantLeft += OnParticipantLeft; _conjureKit.OnEntityDeleted += OnEntityDeleted; _conjureKit.OnParticipantEntityCreated += OnParticipantEntityCreated; _conjureKit.OnStateChanged += OnStateChange; _manna.OnLighthouseTracked += OnLighthouseTracked; _manna.OnCalibrationSuccess += OnCalibrationSuccess; }
For more information on these callbacks, please refer to ConjureKit core package and OnLighthouseTracked.
And then we'll declare these methods to listen to the respective events above:
#region ConjureKit Callbacks private void OnJoined(Session session) { } private void OnLeft(Session lastSession) { } private void OnParticipantLeft(uint participantId) { } private void OnEntityDeleted(uint entityId) { } private void OnParticipantEntityCreated(Entity entity) { } private void OnStateChange(State state) { } private void OnLighthouseTracked(Lighthouse lighthouse, Pose pose, bool closeEnough) { } private void OnCalibrationSuccess(Matrix4x4 calibrationMatrix) { } #endregion
Now that we have prepared all the needed callbacks, let's add a way to update the Session ID and the ConjureKit State in ^UIManager.cs^:
UIManager.cs^
public void SetSessionId(string id) { sessionText.SetText(id); } public void UpdateState(string state) { stateText.SetText(state); }
With the above methods declared, let's call them in the ^OnJoined^ callback:
OnJoined^
#region ConjureKit Callbacks private void OnJoined(Session session) { _myId = session.ParticipantId; _session = session; uiManager.SetSessionId(_session.Id); }
and ^OnStateChange^:
OnStateChange^
private void OnStateChange(State state) { _currentState = state; uiManager.UpdateState(_currentState.ToString()); var sessionReady = _currentState is State.Calibrated or State.JoinedSession; _arCameraFrameFeeder.enabled = sessionReady; }
Now we should be able to see the Session ID and the ConjureKit State upon running the project. By enabling the ^_arCameraFrameFeeder^ when the current state is ^JoinedSession^ or ^Calibrated^, Manna will start scanning once we are connected to a session, and will stop automatically if we are disconnected.
_arCameraFrameFeeder^
JoinedSession^
Calibrated^
申请 AUKI 代币补助金以启动您的项目,并直接与 Auki Labs 团队合作,将您的创意推向市场。成功申请者可获得价值高达 10 万美元的 AUKI 代币,以及 Auki Labs 团队提供的开发和营销支持。