Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

jolo309

[C#] Hunger & Thirst in one script

Recommended Posts

jolo309    79

Hello, I quickly put together a hunger and thirst script, and I just wanted to share something with you all, and you can use it as you please :)

 

HungerThirst.cs

Please login or register to see this spoiler.

 

  • Like 2

Share this post


Link to post
Share on other sites
hootzoo    0

what unity asset's work for the UI / Text ?

 

looks great just wanna try it out :)

Edited by hootzoo

Share this post


Link to post
Share on other sites
jolo309    79
Please login or register to see this quote.

I have only set it up with Unity's new GUI system from 4.6 :) But with a few small changes in the code, then you can use other GUI systems too

Share this post


Link to post
Share on other sites
hootzoo    0
Please login or register to see this quote.

 

ok thank you, I'll try to edit for unity 5

Share this post


Link to post
Share on other sites
jolo309    79
Please login or register to see this quote.

It already works for Unity 5, as it uses the same GUI system as 4.6 :)

You only need to attach the scripts to a gameobject and make the UI text, and then assign the UI texts to the scripts in the inspector :)

  • Like 1

Share this post


Link to post
Share on other sites
hootzoo    0
Please login or register to see this quote.

 

ok sweet tank you very helpfull !!

 

EDIT: got it working and works great !

Edited by hootzoo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×