In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use NEO and Unity to make games related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this article on how to use NEO and Unity to make games will have a harvest, let's take a look.
Private test network
NEO Lux provides some convenient ways to connect your game to the official test network or the main network.
But in this tutorial, we will build our own private network. This ride is very simple, and once you have overcome the initial obstacles (I will guide you), you will find it easier than using a test network. For example, while filling out the GAS or Tokens application form for testing may not be the most difficult task in the world, I have found that such a small friction tends to stifle my enthusiasm and motivation.
You can also run your own private network locally, but in this tutorial, we will set up our own server. This makes things like team work or build work easier and more straightforward. I will use Digital Ocean. Because according to my experience, they have good performance-to-price ratio.
Disclaimer: I'm not a back-end / server developer, and I guess "medium" people would like to use command-line tools. For those who know what they are doing, this should be easy. If you know Linux and Docker, you can install NEO PrivateNet directly from Docker Hub and run NEOSCAN using Docker Compose. For others who are more or less at my level, the next content should be quite simple and straightforward.
If you don't already have a Digital Ocean account, create one. Then create a Droplet using the following options.
Use the 16.x or 18.x version of Ubuntu
Matching in use should be enough-you can try it yourself in the configuration and tell me the results of your experiment in the comments
SSH logs in to your new Droplet and installs docker. If you follow the guidelines provided by Digital Ocean
Note: I encountered a slight problem in performing the initial step of adding the GPG key of the official Docker library to the system. I simply ran the order twice, and everything went well.
Then install the docker component. Similarly, the installation instructions are very simple. Just make sure you read the instructions for the Linux system.
Install VPC and NEOSCAN
Running and installing our own private network is the most difficult step, but City of Zion's people have helped us do it very well. You can click on this link to see their full instructions. Similarly, when SSH logs in to your Droplet, basically we only need to enter a few commands:
First, download the docker image from hub:
Docker pull cityofzion / neo-privatenet
... Download NEOSCAN...
Wget https://raw.githubusercontent.com/slipo/neo-scan-docker/master/docker-compose.yml
... And run privnet...
Docker-compose- f docker-compose-neoscan.yml up
Get it up and running, and then go to http:your-droplet-ip-address:4000 to see how NEOSCAN is running:
Back to Unity
I don't want to delve into my development style in this tutorial, but one thing I'm going to do is import the UniRx plug-in into Unity. UniRx is a reimplementation of .NET Reactive Extensions that is optimized for Unity and is well compatible with iOS IL2CPP. It doesn't have to be too complex to implement, it can simplify some of the code that manages NEO and UI.
Create another script named NEOManager under assets (Assets)-> script (Scripts), and copy and paste the following code:
Using System.Collections; using UnityEngine; using System; using UniRx; using Neo.Lux.Core; using Neo.Lux.Cryptography; using UnityEngine.UI; public class NEOManager: MonoBehaviour {public NeoAPI API; [SerializeField] private string RpcIP; public const string AssetSymbol = "GAS"; [HideInInspector] public KeyPairReactiveProperty PlayerKeyPair = new KeyPairReactiveProperty (); [SerializeField] private Text addressText; [SerializeField] private Text balanceText; public Decimal GASBalance Private void OnEnable () {PlayerKeyPair.Value = KeyPair.FromWIF ("KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr"); # if UNITY_EDITOR / / this.API = new LocalRPCNode (30333, "http://localhost"); this.API = new CustomRPC (30333, 4000," http://">) saves the script and returns to the main scene. Create an empty game object (GameObject), name it NEO, then create an empty game sub-object (child GameObject) of the NEO object, name it NEOManager, and add the NEOManager script to the NEO object. Enter the IP address of your Droplet next to the RpcIP field in the inspector. Next, we will create some UI elements and connect them to the inspector so that we can see the balance update when we connect to the main network. Create the UI canvas and add two child text elements to it, then click and drag their references to the (Address Text) and (Balance Text) fields of the NEOManager. Click the Play button and view the update of the address and balance. We are currently using the test account that is automatically generated when the VPC is installed. In the next section, we will make some settings so that our players can enter their own private keys and start interacting with the NEO blockchain. Original link: https://medium.com/@tbriley/making-a-game-with-neo-unity-part-2-5e1df705ed39 translation: steamed stuffed bun NEOFANS:neofans.orgNEOFANS Weibo: https://www.weibo.com/neofanscommunityNEOFANS telegram group: https://t.me/NEOfansCN on "how to use NEO and Unity to make games" this article ends here Thank you for reading! I believe you all have a certain understanding of "how to make games with NEO and Unity". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.