Hacking with Unity - Learn how to create your own games
  • Unity Basics
  • Unity Tips
  • C#
  • Free Resources
Log in Subscribe
Log in Subscribe
  • Unity Basics
  • Unity Tips
  • C#
  • Free Resources

HackingWithUnity

Hi I'm HackingWithUnity
70 posts
Unity Basic

Get time difference between two date

In C#, we can easily add or subtract two dates just like numbers. Example of getting how many days, weeks of two dates // Get time difference between two date DateTime

  • Go to the profile of  HackingWithUnity
HackingWithUnity
5 Jan 2021 · 1 min read
Unity Basic

How to create and use Dictionary in Unity using C#

Like many other languages, C# does have the dictionary data type: Features of Dictionary in C#: * Not sorted * Key-value pair using System.Collections.Generic; // example of string key and value

  • Go to the profile of  HackingWithUnity
HackingWithUnity
3 Jan 2021 · 1 min read
Unity Basic

How to convert a String to Array in C#

Image we have a string: 123,456,78,789, we want to change it to an array, we can use the following code: string szTmp="123,456,78,789"; string[

  • Go to the profile of  HackingWithUnity
HackingWithUnity
2 Jan 2021 · 1 min read
Action and Func in C# Unity Basic

Action and Func in C#

Actions and func are another ways to create delegates. Action is a delegate that points to a method which in turn accepts one or more arguments but returns no value.

  • Go to the profile of  HackingWithUnity
HackingWithUnity
27 Dec 2020 · 1 min read
Free 3D Asset Create Tool - Magicavoxel Free Resource

Free 3D Asset Create Tool - Magicavoxel

Magicavoxel is one of my favorite tools for creating voxel 3D objects. There are quite a few popular voxel like games such as Minecraft on PC, Xbox and PlayStation, and

  • Go to the profile of  HackingWithUnity
HackingWithUnity
3 Dec 2020 · 1 min read
Add flashlight to your character in 2D project Unity Tips

Add flashlight to your character in 2D project

It is quite common to see fog in the game development. The character only can see places in a certain range. For example, in the game Don't Starve, the player

  • Go to the profile of  HackingWithUnity
HackingWithUnity
28 Sep 2020 · 2 min read
Get mouse input in Unity Unity Basic

Get mouse input in Unity

To get the mouse input event in Unity, we have to create a script attached to your game object. Then add the following script to it: Mouse click using UnityEngine;

  • Go to the profile of  HackingWithUnity
HackingWithUnity
21 Sep 2020 · 1 min read
Display Game Object's layer name in Hierarchy Unity Tips

Display Game Object's layer name in Hierarchy

It is especially useful when we have numerous game objects in the Hierarchy, the following is one example of showing game object's layer name: Note that Default, Player, UI are

  • Go to the profile of  HackingWithUnity
HackingWithUnity
20 Sep 2020 · 1 min read
Free 2D Asset: Handcraft Art Free Resource

Free 2D Asset: Handcraft Art

Free Asset - 2D Handcrafted Art | 2D Environments | Unity Asset StoreElevate your workflow with the Free Asset - 2D Handcrafted Art asset from Alien Nude LTD. Find this & more Environments

  • Go to the profile of  HackingWithUnity
HackingWithUnity
16 Sep 2020 · 1 min read
How to run unattached script in Unity Unity Tips

How to run unattached script in Unity

As we know, the script is yet another object/component in the Unity, therefore you can either attach the script to an game object or get called explicitly in order

  • Go to the profile of  HackingWithUnity
HackingWithUnity
14 Sep 2020 · 1 min read
How to install and enable URP (Universal Render Pipeline) Unity Tips

How to install and enable URP (Universal Render Pipeline)

Universal Render Pipeline formerly named the Lightweight Render Pipeline, which provides many pre-built functions that can help you quickly and easily optimize graphics and effects across a range of platforms.

  • Go to the profile of  HackingWithUnity
HackingWithUnity
9 Sep 2020 · 3 min read
Add Custom menu Item on Unity System Menu Unity Tips

Add Custom menu Item on Unity System Menu

What is the Custom menu? Look at the MyMenu on the top bar: Unity provides a powerful way to help us to add custom item to its menu, which can

  • Go to the profile of  HackingWithUnity
HackingWithUnity
6 Sep 2020 · 1 min read
Unity: 2 ways to play animation Unity Tips

Unity: 2 ways to play animation

Animation is indispensable part for any game, this article demonstrates two ways to play animation in Unity. Approach 1: use animation parameter In the bellow example, there are three animations

  • Go to the profile of  HackingWithUnity
HackingWithUnity
5 Sep 2020 · 1 min read
Free Resource

Free Unity Resource: Pixel Font

You can use this resource whatever you like in your own project! Pixel Font - Tripfive | 2D Fonts | Unity Asset StoreElevate your workflow with the Pixel Font - Tripfive asset

  • Go to the profile of  HackingWithUnity
HackingWithUnity
4 Sep 2020 · 1 min read
Unity Basic

Set up global variable in Unity

Keep your global variables separately is always a good practice no matter what programming language you are working with. using System.Collections; using System.Collections.Generic; using UnityEngine; public class

  • Go to the profile of  HackingWithUnity
HackingWithUnity
4 Sep 2020 · 1 min read
Unity Plugin: Device Simulator Unity Tips

Unity Plugin: Device Simulator

When developing on mobile games, it is necessary to make sure the game is compatible on most of the screen size. Device Simulator is such a plugin or package which

  • Go to the profile of  HackingWithUnity
HackingWithUnity
3 Sep 2020 · 1 min read
Superpowers Asset Packs Free Resource

Superpowers Asset Packs

Royal Free 2D/3D assets, you can use it whatever you want in your game. Download Link: sparklinlabs/superpowers-asset-packsCC0-licensed asset packs for your games. Contribute to sparklinlabs/superpowers-asset-packs development by

  • Go to the profile of  HackingWithUnity
HackingWithUnity
2 Sep 2020 · 2 min read
Unity Show FPS in scene Unity Tips

Unity Show FPS in scene

The following script will help you to show FPS in scene: using System.Collections; using System.Collections.Generic; using UnityEngine; public class FBSManager : MonoBehaviour { public int rangeInt; public float updateInterval

  • Go to the profile of  HackingWithUnity
HackingWithUnity
31 Aug 2020 · 1 min read
© 2023 Hacking with Unity - Learn how to create your own games. All rights reserved.