In this post, you will see some interesting UnityTips and tricks related to C# scripting in Unity3d Environment.
Read More- Unity Tips and Tricks Part I
- Unity Tips and Tricks (Scene Tips and Tricks) Part II
- Unity Tips and Tricks (Unity Coding Tips and Tricks) Part III
- Unity Editor Tips and Tricks Collection
These all beautiful #Unitytips collection is gathered after an extensive search from the Twitter game development community. So let's get started without any particular order:
#UnityTips Improve handling your enums in the inspector by giving them a better description for the values with the [InspectorName] attribute 😎#gamedev #indiedev pic.twitter.com/5UO5g6o5G4
— Binary Impact (@BinaryImpactG) March 8, 2022
My [Resolve] annotation allows you to quickly resolve references in the editor #unity3d without dragging and dropping.https://t.co/YedOYeX2fS#unitytips pic.twitter.com/scIXic4cH7
— Alex Hetherington (@FootnotesFuture) December 21, 2021
#UnityTips You can change how unity handles script recompilation!
— Binary Impact (@BinaryImpactG) July 13, 2021
Go to: Edit -> Preferences -> General -> Script Changes While Playing
We are mostly using "Recompile After Finished Playing" to avoid a lot of common error messages and unity crashes.#gamedev #indiedev pic.twitter.com/4XjWSkfCjb
#UnityTips If you need to know when your touch input is over a UI element to stop
— Binary Impact (@BinaryImpactG) August 17, 2021
your camera from moving in your mobile application,
check out IsPointerOverGameObject.
It works for any EventSystem object, technically not just UI.#indiedev #gamedev #mobiledev pic.twitter.com/z9pXtxqYJq
Use the Highlighter API for editor tooling tutorials or drawing attention to controls & rects #UnityTips pic.twitter.com/fIN5asVHzv
— Barnaby Smith (@mvinetwork) July 18, 2021
#UnityTips If you need to know when your touch input is over a UI element to stop
— Binary Impact (@BinaryImpactG) August 17, 2021
your camera from moving in your mobile application,
check out IsPointerOverGameObject.
It works for any EventSystem object, technically not just UI.#indiedev #gamedev #mobiledev pic.twitter.com/z9pXtxqYJq
#UnityTips time!
— Game Dev Guide (@GameDevGuideYT) July 13, 2021
Use the "hasUnsavedChanges" and "saveChangesMessage" properties to customize what happens when you close an Editor Window.
You can use this to undo changes made to a scriptable object by unloading it from the Asset Database. pic.twitter.com/i4IBmfo3IE
just a monobehavior i slap onto my object, not a real editor script, very easy to set up
— Alex Strook (@AlexStrook) May 28, 2021
make sure to remove it and/or use "if UNITY_EDITOR" to avoid compilation error pic.twitter.com/DuOTVCK2K7
With the latest @unity 2020 LTS you can use some of the new features in C# 8.0! One of my favorites is a switch expression which greatly reduces the syntax required. It's not a full replacement for switch statements but works well for linking data together. #UnityTips pic.twitter.com/tAB3mxfxvN
— Dan Miller (@DanMillerDev) May 11, 2021
You can use the debug inspector to change which script a MonoBehaviour on a GameObject is using, and if they have the same field names, the serialized data will persist!
— David Evans (@phosphoer) August 27, 2021
Really useful for switching to a derived type or just a similar script#unitytips pic.twitter.com/Jz5tlpFxu4
for those of you who are stuck in the stone-age of 'print debugging', (as am I):
— thomas ⛰ vandenberg (@noio_games) May 5, 2021
replace your calls to
Debug.Log("HELLO")
with this 👇 — and at least make it pretty#unitytips pic.twitter.com/U87Mb5taYl
💡One cool method from MonoBehaviour is the OnValidate method. It is called when the script is loaded or a value changes in the Inspector. That way I can assign a field automatically instead of manually do that✨👌#indiedev #unitytips #gamedev #unity3d pic.twitter.com/LFUDkYee71
— sailor 🛠Myst Valleys (@elvismdd) October 3, 2021
0 Comments