⭐OnApplicationFocus() 📱 Sent to all GameObjects when the application loses or gets focused 📱 Function: checks if the current application is in focus or not 📱 Called immediately after OnApplicationPause() ✅ 📱 Called when an application (unity editor window) gets or loses focus 📱 when an application goes to the background (boolean: false ), as the game application has lost focus 📱 Returns false when
Unity3D Scripting API #11: OnApplicationPause() 📱
⭐OnApplicationPause() 📱 Sent to all GameObjects when the application pauses. 📱 Called after OnEnable()if the script component is enabled ✅ 📱 Called after Awake() if the script component is disabled ❌ 📱 Called when an application goes to the background (true) 📱 Called when an application comes to the front (false) 📱 OnApplicationPause() takes a boolean (true or false) as an argument
Introduction to C# in Unity3D #5: Variables 📦
📦 A variable is a reference to some value in memory (either stack or heap) 📦Think of it as a container for holding a value. 📦C# is a strongly typed language. In C# when you declare and initialize a variable you must specify the data type of the value that the variable will hold/reference, followed by the variable name and then assign it a value:
Introduction to C# in Unity3D #4: Data Types – 2 🌌
🌌 Data types refer to a type of data for example character, sequence of characters (string), whole number , decimal etc 🌌 C# is a strongly typed language which means you have to indicate the data type of a value that a variable will refer to 🌌The Datatypes are something which gives information about: 1. Size of the memory location. 2. The range of data
Unity3D Scripting API #10: OnDestroy() ⚔️
⭐ OnDestroy()⚔️ Called when a gameObject or component is destroyed⚔️ Called when current scene or game ends. Or the play mode is exited from.⚔️ You should de-initialize variables and references inside onDestroy()⚔️OnDestroy() deletes/destroys the object completely because it won’t be re-used
Unity3D Scripting API #9: OnDisable() 🛡
⭐ OnDisable() 🛡️Called whenever the script component is disabled 🛡️ Also called when a game object is destroyed. When you quit your game, the scripts (which are game objects) are destroyed and this triggers the OnDisable() event method
Unity3D Scripting API #8: OnEnable() 🕹️
⭐ OnEnable(): ⭐Event methods get called automatically by the Unity3D engine at pre-determined times 🕹️Called after Awake() 🕹️Called whenever the script component is enabled which can be more than once 🕹️ Usage: Resetting variables and current object properties. Or for executing code when the script component is enabled 🕹️ Start() is called once, OnEnable() is called every time the script component, or the object it’s
Introduction to C# in Unity3D #3: Data Types 🌌
🌌 Data types refer to a type of data for example character, sequence of characters (string), whole number , decimal etc 🌌C# is a strongly typed language which means you have to indicate the data type of a value that a variable will refer to 🌌The Datatypes are something which gives information about 1. Size of the memory location. 2. The range of data that
Unity3D Scripting API #7: Awake() ☀️
⭐Event methods get called automatically by the Unity3D engine at predetermined times. ☀️Called only once in the lifecycle of a script ☀️Called even if the script component is disabled ☀️It is an initialization method like Start() . Called at the beginning when game objects are created and initialized. Awake() is called when the object that the script is attached to is initialized ☀️ Usage: Awake()
Unity3D Scripting API #6: LateUpdate()☑️
⭐ LateUpdate(): ☑️ This is called after each Update() method call ☑️This is useful to ensure all Update() related calculations are completed, and then any other dependent calculations can be called. For example, if you need to integrate a third-person camera to follow a character, then it should be implemented inside LateUpdate() method. This ensures that the camera will track the character after its movement