In todays #Unity3d for #crypto and #cryptogame s we are going to finish setting up registration so we can send some #ether using Nethereum assetts for Unity3d! if you want to see how to make your own crypto game, stay tuned!
Like and Subscribe!
Send me a gwei! (ether address, all donations accepted!) 0x95F4EaB8A738F4F27e7c04aEe1E10C8E666C2D0c send me a satoshi! (bitcoin address, all donations accepted!) 31zvj8ybxVVTLw6nPvAHYqu3qDVhC1sRqk
Want to send me something? Technivorous 902 n Hughes Blunt Sd 57522
Hey all, welcome back. TechNervous here. Today we are going to be fixing this. So we have everything
set up the way that we want and I'll be honest with you, so in order to do this generally we
are going to need a database. That's not what this video is about, so we're going to simplify
things a little bit. I will be incorporating a database into this setup eventually, so stay
tuned if that's something that you'd like to see. But for now we're going to set this up simply for
one user and one user only, which means it's not going to check to see if there's already an
account with that name. It's just going to create the account no matter what name we put in. Since
there's only one account that we're dealing with at any given time until we build that database,
it's not really going to have anything to compare it to and there shouldn't be duplicate accounts.
So let's jump right into this real quick and I want to hit the play button because I want to
show you what's going on here. So if I hit play, it's going to bring me up to this menu where I
should be able to select each of these text boxes and type something in. The important thing that we
need to remember here is that the password is something that we are not going to have access
to. That is for the user only. That's why there is a warning saying we're unable to retrieve your
password if lost, so write it down somewhere safe and be sure to check the capitalization spelling.
Excuse me. Okay, so here we are. So now I can enter my text. Let's make that be my name
and for an account password, let's do ftest, all lowercase, okay,
and I need to type the same thing in the second box. Now this isn't set up to do anything. We're
going to set up that logic now. We need to check before we register this account that both of these
passwords are the same. If they're not the same, we need to point that out. We need to erase these
text box and have them start over to ensure that they are typing the same thing and that it is not
something that they don't think that it is because when this is said and done, this text box is going
to be hidden. You're not going to actually be able to see this. It's just going to be asterisks
asterisks because we can set this text box to be something that is, you can see content type
password. So you can see it's changed to asterisks, okay. We actually need to do that with the other
pass field as well, but we are going to leave it for now because we want to be able to see what
we're doing. So pass field, change that back to content type standard so we can see what we're
doing and then we're actually just going to stop and not hit the play button. We need to get a hold
of our script that is in here. So let's go to, let's see, register scene. Okay, so this is basically
just loading a scene. That's all this does. We want to take and get a couple of variables. We're
password here is going to be our password. And when we're, when it's all said and done,
we'll make these so they're not public and we're storing this in the wallet because the wallet
will persist. This will stay in here and that's what we want for now. Okay. This will eventually
get moved for security reasons, but for now this is going to work out well. So let's say
create accounts. Okay, so it's not going to return anything. It's just going to create an
account in here. We want to call our create account method. Remove this from here now
and we don't want to get a balance just yet. We'll use this later.
So we're not doing that in on start. What we're going to do is,
let's see. So when we click create account, we want to set our variables here. So wallet,
strong password, repass, strong password. We need to go into unity, name field, name field,
pass field, repass field, repass field. Okay, so strong password equals tag. We need the big one.
Pass field, dot get component, and that component is font. We need to get
unity engine dot text. Okay, so we are setting strong password equal to the value of this.
I'm going to do this again, except with repass field. We also need the right tag,
name field. Okay, so now I have these items. Okay, so instead of strong password, I'm going to,
okay, so I'm passing strong password. I'm not passing an address because it doesn't have one
yet. It's going to create an account. Let's just print the address. So we're going to print the
address of our newly created account. What we need to do is first check that strong password
equals equals repass. Then we can run this routine else your passwords do not match. Okay,
so that is still not quite everything that we need to do. We need to make sure that those
buttons work properly to do, to call this method to create an account. So what we need to do is
go back into here. It's going to compile again. We need to go and change that button from running
off of this register scene method to the account F and making it create an account. It's going to
throw an error down in our debug console. If those passwords don't match, that's the only thing we've
set to check for yet. So I'm seeing this button out here, register button, subtract that,
add new object, see count F and create an account. Okay, so this should work.
I'm going to go in and take this scene management line and actually start a new scene
after we do that as well. Not just yet. So if the password works, then we'll start a new scene
and then we'll create the account. So save that. We will see what we get here.
First, we're going to make it fail. Count your passwords do not match. It does not go any further.
Okay, so let's make it match. I'm not getting any errors. It should be loading, but it's not. So
let's try it without changing scenes right there because I think I might have created a little bit
of a loop we didn't want there. So let's try this again. We're going to create a UI pop-up that pops
up and says passwords do not match. So it doesn't just show up down there. Right now, let's do
play. And it did finally create it. It was just having issues between
changing scenes. So we should see this instead of anything else. That doesn't matter. Ho ho,
ho ho, create account. It is just taking a minute. So we're going to let it run,
see what's going on here, and see if we can speed this process up at all. But it did go through. It
did work. Now would be a good time to load the next scene and I would still have all of my data
persistent with this here. So let's do that right now one more time and then we will finish out this
video. So once it's done that, then we'll load a new scene. So let's... it would be better if it
loaded that scene while we were waiting. But we'll get to that as well. Okay, so account name,
account password, account password. I don't know why it's not clearing these. But let's get that
error again. Okay, passwords do not match. Create account. And this time, obviously, it'll work.
It'll take its time. Hopefully, after it pops up this display here, it should move to the next
scene. And in that scene, in the next video, we're actually going to display our Ether balance in the
corner and make a button for retrieving it. We don't want it to update constantly because that
asks too much yet. Here we are in the next scene. We have our account. It has our username and our
passwords logged in and stored. So that's it for this video, guys. This is really getting down to
where we're going to be using some new methods soon for sending and receiving cryptocurrency.
And I will show you what exactly that is useful for. So speaking of sending and receiving
cryptocurrency, I have a couple of addresses down below. If you'd like to send me some Bitcoin or
some Ether, please do. All donations are appreciated, anything from Gui to Satoshi.
I don't expect much, but if you like these videos, you'd like to see them continue.
Donations are always welcome because, obviously, nobody's doing this for free. So we'll move on to
the next one real shortly here. But for now, hit that subscribe button, leave a like on this video,
and don't forget to ring the notification bell so you can get notified when we make more videos.
Now, I do have a whole playlist planned for the whole development of this game, and hopefully
you guys are interested and staying tuned. So that's going to be it. Techniverous out.