Unity Tips How to prevent colliders from passing through each other Collisions with fast-moving objects are always a problem. A good way to ensure that you detect all collisions is to use Raycasting instead of relying on a physics simulation. This HackingWithUnity 22 Mar 2021 · 1 min read
Unity Tips Mouse Click or Finger tap only on either game objects or UI objects When facing the situation that we want the mouse click and finger tap can happened only on either game objects or UI items. Here is how: using UnityEngine.EventSystems; private HackingWithUnity 15 Mar 2021 · 1 min read
Unity Tips Unity Mesh Introduction What is Mesh Mesh is a component in Unity, called mesh component. Simply put, Mesh refers to the mesh of the model. The 3D model is made up of polygons, HackingWithUnity 10 Mar 2021 · 2 min read
Unity Basic Walk Through Monobehaviour Like other fundamental parts such as GameObject, Compoent, Time, Input and Physics, Monobehaviour is an essential member for writing the script, which is the soul of an GameObject. This article HackingWithUnity 8 Mar 2021 · 1 min read
Unity Tips Coordinate system in Unity Unity uses several different coordinate systems at the same time, as follows: Screen Space Also named Screen point system. The screen coordinates are defined in pixels. The lower left corner HackingWithUnity 6 Mar 2021 · 2 min read
C# Date time in C# It is quite common to see Date and Time used in the game, here are some frequently used methods: Get the current date time // Get the current date and time HackingWithUnity 4 Mar 2021 · 1 min read
Unity Tips Unity plugs Genshin Impact used Genshin Impact is an open-world action role-playing game developed and published by miHoYo, gained millions of users since it was launched. But how does it to achieve its amazing visual HackingWithUnity 25 Feb 2021 · 2 min read
C# Ternary Operator in C# Also called One-line if: Syntax condition ? consequent : alternative Example using UnityEngine; using System.Collections; public class TernaryOperator: MonoBehaviour { void Start() { int age = 20; string message; message = health > 20 ? "should buy HackingWithUnity 23 Feb 2021 · 1 min read
Unity Tips Copy and paste component properties It is quite common to adjust value while developing a game, and sometimes we need to put down those values while game is running. There are two ways of doing HackingWithUnity 22 Feb 2021 · 1 min read
C# Namespaces in C# Namespaces are like containers for classes, which can help us organize the code, we see the same concept in other programming languages such as Java, Python and other languages. The HackingWithUnity 19 Feb 2021 · 1 min read
C# Properties in C# Like many other programming languages, C# class does have the class properties, also called fields. Example of the class property public class Player { private int experience; public int Experience { get HackingWithUnity 19 Feb 2021 · 1 min read
C# Use Singleton in Unity Singleton is a common design pattern in programming, which keeps only one copy of a variable or object throughout the entire runtime of the program. Create a Singleton is quite HackingWithUnity 18 Feb 2021 · 1 min read
Unity Basic Get game object active status in script It is quite often important to know whether a game object is active or not. bool menuStatus = gameobject.activeSelf; gameObject is the game object in the hierarchy. We can use HackingWithUnity 18 Feb 2021 · 1 min read
Unity Tips How to find out a script is used by which game objects Our game objects might have lots of scripts, game objects and scenes, we probably can't remember which script is being added to which game object. Unity does provide a built-in HackingWithUnity 15 Feb 2021 · 1 min read
Setup icons in Unity Once we have done the development on the game, it is time to add icons. Take the iOS platform for example: In the Unity, File -> Build Settings to open HackingWithUnity 14 Feb 2021 · 1 min read
Unity Basic Extension Methods Extension Methods are a feature that adding new methods to an existing class, which class is non-generic but static class. Similar to the extension concept in Swift. Features of Extension HackingWithUnity 24 Jan 2021 · 1 min read
Sharing global data among different scenes Global data can help us to share data or variables among different classes, even in different scenes. Used scenarios such as game options including music volume, selected character's skin and HackingWithUnity 23 Jan 2021 · 1 min read
Unity Basic Output formatting in C# See the following examples for the formatting on float and date: using System; using System.Globalization; using System.Threading; namespace CSharpLearning { class Program { static void Main(string[] args) { double f HackingWithUnity 7 Jan 2021 · 1 min read