Handle OnBecame[Inv|V]isible to avoid unnecessary work in scripts attached to game objects that are not in the camera view
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍1
Remove confusing indentations by getting rid of some nested if/else constructs.
Often the else statement is not needed & the code can be optimized to have less indentations & more readability.
Here is an easy example to show a use case
#نکته #یونیتی
👉 @UnityEngine3D 👈
Often the else statement is not needed & the code can be optimized to have less indentations & more readability.
Here is an easy example to show a use case
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍1
In a Unity scene, hold the 'V' key while the translate tool is active and you can drag an object by a vertex and snap that to one of another object's vertices
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👌4
Speed up your Unity3d workflow by adding an Assembly Definition to script folders. Unity compiles these scripts into their own assembly, rather than Assembly-CSharp.dll, => shorter compile times!
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍2🤔1
As you develop your games, copy generic components and methods into a common library. You can then export this as a Unity package and import it into other projects. It also encourages a component approach to your coding.
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍1🔥1💔1
The MenuItem attribute can also be used to create a menu hierarchy and assign a key shortcut for your editor tools. % = Ctrl; # = Shift; & = Alt; _ = no modifier. See https://docs.unity3d.com/ScriptReference/MenuItem.html
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍1👏1
Setting Time.timeScale to 0 is an easy way to pause your game, but make sure your UI code doesn't rely on Time.deltaTime or WaitForSeconds(). Use Time.unscaledDeltaTime to avoid this issue
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
💯4⚡1
Did you know that you can have multiple scenes open in the Unity editor? Just drag your additional scenes into the hierarchy. Only one scene can be active. An easy way to compare scenes.
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍2
Use the Ctrl key to snap game objects in your scene to the grid. Change snap units in Edit / Grid and Snap Settings. You can also toggle Grid Snapping when in Global handle rotation mode
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍5
Use the ExecuteInEditMode attribute on your MonoBehaviour if you want any code to run while in edit mode, in addition to play mode. Update is only called when something changes in the scene
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍3