Skip to main content

Posts

Save System for Unity - Technoob Technology

Unity API has a class called ‘PlayerPrefs’ which allows saving basic data types with a string key. But when a game becomes complex ‘PlayerPrefs’ can't save all the data and it's so hard to access them as you have to remember all the keys and call one by one. To avoid this we can create a custom save system which can save a class at once which contains all the data values. We need two scripts for this save-system.             01.SaveSystem class             02.SaveData class Save system class will contain all the methods to save and retrieve data and ‘SaveData’ class is used as the base class for the classes we going to create to store data.   ‘SaveData’ class doesn’t contain any methods and not extended by any other classes or interfaces. Make sure to mark this class as ‘[System.Serializable]’ in order to make sure this is serializable. ...

Unity Native Toast - Technoob Technology

Unity engine is an awesome game engine but it doesn't contain a toast system within its API. In this article, you gonna learn how to create a toast system like the native Android toast system in Unity Engine. To accomplish this we need a tween engine and for this tutorial, we are using LeanTween which is available in the Unity asset store for free. You can change this to whatever tween engine you would like to use. Let's get started.  This module contains only a single script and pretty easy to understand. Let's call the class as 'Toast' to give a taste of what this is for. First, we need to create canvas prefab with a rounded rectangle and a text element. Then We create the script called Toast and this should be a singleton in order to keep this toast canvas in every scene without destroying. The singleton pattern is simple and what it does is check if there is another toast canvas and if there is another one destroys the current o...

Unity Get Post web requests - Technoob Technology

Web requests in unity are super easy to use. We gonna use the UnityWebRequest class as the WWW class is deprecated now. UnityWebRequest class can be used for both Get and Post methods. The 'UnityEngine.Networking' namespace is required to work with UnityWebRequests.  This tutorial is made with some simple UI elements. First Let's see how the GET method works. 01. UnityWebRequest.GET We use this method to receive data from the server as normal get requests. Using coroutines in web requests is mandatory as we have to wait until the download is complete before showing the results, and the coroutines make this much easier. A simple button calls the method and a text element will show the result. The script contains a reference to the text element and the string URL of your PHP file.  When the button is pressed the button executes the ButtonGetData method and that method simply starts the GetData coroutine. We use the using keyword as this data ...

Object Pooling system for unity - Technoob Technology

As a game developer, you might have experienced performance issues when instantiating new game objects in a  game. This is a very usual thing as instantiating an object in the middle of the game costs a severe amount of  CPU power. Professional game developers use various methods to avoid instantiating objects like this. Pooling is  the most popular method to do this. We gonna target unity engine in this tutorial and this class is created in C# language.  A pool is a set of instantiated game objects but disabled. When a class or method requires a game object of that type  pool simply takes one of the game objects from the pool and returns it. We can create pools within each class and that is going to be  very hard to manage and time wasting as you have to rewrite the same code again and again. To avoid this we are going to create a  custom class called Pool and implement all the functions a pool should contain within it.  As we...

How games are made? - Technoob Technology

What is the best game you've played? Did you ever wonder how these awesome games are made? Well, here we are going to explain to you that.  Game Development is a long process which is done step by step. You might be thinking that programmers are the people who develop these awesome games. Actually, that's not the truth. There are hundreds of people behind a successful game, who have different expertise in various fields. The most important thing about a game is the idea. You might have noticed that games with different gameplays than regular games have more attraction and user engagement. There are hundreds of multiplayer shooting games, but think what PUBG did. It has a different approach than regular shoot and kills games. Its basic rule is to survive instead of killing and following objectives. Same happened with the flappy bird which made $50000 per day according to the Wikipedia .  Then the game designers come in to play. Their task is to design ...

mini mouse for laptop - Technoob Technology

When it comes to a laptop it's really challenging to find a perfect mouse which is very mobile while giving a good performance. Even in the market most of the high dpi mouse is developed for desktop computers. As it is a huge problem for laptop users to find a good mouse we searched for the top 3 mini mouses which are specially developed for laptops in the market and collected pros and cons of each mouse. 01 Logitech M187 This is a wireless mouse which makes it more mobile. M187 has a sleek smooth design and it has an extra small design which makes it pocket ready. When it comes to performance, this is developed by Logitech. That's enough to understand how powerful this mouse is. This mouse weighs 52 grams while the receiver weighs only 1.8 grams.  It has an optical sensor with 1000dpi sensor resolution. The mouse contains a 2.4GHz advanced wireless connectivity.  It is powered with a 1 AAA type battery and a single battery can power up this handy mouse around...

How to make an Event-System for unity - Technoob Technology

First, What is an Event-System? An Event-System is a collection of scripts we use to send messages between game objects without linking them through the Unity inspector. The best use of this is when you want to connect a game object of the scene to a prefab. Unity Engine doesn't allow us to do that through the inspector and the best way to get this done is by using an Event-System. What if you have 50 enemies in the game and you want to notify them all when the player dies. Without an Event-System we have to connect all the enemies to a manager or some kind of a script to do that... Think about having an array of 50 enemies. This can be solved easily using an Event-System. We will do a basic example of using this event system in the end of the article. Well, now we know the advantages of using an Event-System. Lets start coding our own simple Event-System. First we have to get an idea on how this works. First, a script in the scene raises an event using a static method o...