Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Saturday, 21 February 2015

[Unity3D] Starting & stopping coroutines

Recently I was figuring out how start and stop coroutine works in Unity. And here you can find what I find out.



First things first.

What are those "Coroutines"?


They are almost same as functions but you can program them to work over time.
For example: if you'd like to tween a button or fade out any object over time you'll be able to do that only with coroutines (or very complex and strange Update... ;) ) because they are not limited to single frame like normal functions.

If you are looking for better explanation what coroutines are you can find it on the end of the post.. ;)

Friday, 25 July 2014

XML with Linq - how to save and load those files?! [Unity3D]

Recently I was fighting with saving and loading XML files using Linq which was quite odd.. Especially when this make you headache..


Some of you may not even think about it when you have some small projects but in bigger one.. Data serialization might be real challenge. I was doing some research for dealing with it and I found 2 most common methods: 
  • Unity Serialization, which work automatic with just adding [SerializeField] over variable or class
  • Writing own serializer and save data to XML, JSON or any other file
First I was thinking that the first method might be good for me but suddenly... Wild "I'm not this type of guy" appear.. And that mean that I have to know what's going on in project so I start digging and looking for information about dealing with XMLs... :P

Input Reader [Unity3D] - Updated!

So InputReader was updated to read individual joystick axes.
This should work with multiple controllers at the same time. (hope so!)
Unfortunately Unity does not allow to create or modify axes from code so you have to manually add axes to InputManager... (link to example below)

New InputReader is [here].
And example of InputManager with individual axes is [here] (simply copy this to ProjectSettings/ in your project).

Friday, 11 July 2014

Input Reader [Unity3D]

I'm just working over my customizable input manager and the first thing that was a little though was reading input from keyboard. So I just wrote one and I hoped that it will be helpful.

So here you can find that script in my public repository [InputReader]

Monday, 9 September 2013

JSON - how to convert variables it into text and vice versa (with Unity3D & PlayerPrefs)

Recently I used JSON a lot and I'd like to share some knowledge about it.
Here I'm using MiniJSON (link) because I prefer C# rather than JS (this one make me sick!).


So at beginning what JSON is?
JSON is a... string :) And it can have our arrays, dictionaries, variables and other crazy things. And this is all about it, but if you like reading you should go to Wikipedia and read all about it :P