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
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
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 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
C# How to create struct in C# Like Enumerations, struct is value type, which means if you create a struct variable which holds its actual value not the reference. If you try to modify the value and HackingWithUnity 23 Aug 2020 · 1 min read