Create a multiple choice enum like the layer mask with the System.Flags attribute.
Note that your values have to start with 2 and have to be a power of 2 as well
You can also combine it with the InspectorName attribute.
#نکته #یونیتی
👉 @UnityEngine3D 👈
Note that your values have to start with 2 and have to be a power of 2 as well
You can also combine it with the InspectorName attribute.
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍6
If your models are named correctly then unity will automatically create LODs upon importing your FBX.
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍1🔥1
This media is not supported in your browser
VIEW IN TELEGRAM
You can use LOD-Groups to fade materials
Set "Fade Mode" to "Cross Fade" & "Fade Transition Width" to any value higher that 0
Create a shader with "Alpha Clipping" & a custom function node containing the LOD fade
#نکته #یونیتی
👉 @UnityEngine3D 👈
Set "Fade Mode" to "Cross Fade" & "Fade Transition Width" to any value higher that 0
Create a shader with "Alpha Clipping" & a custom function node containing the LOD fade
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍2
This media is not supported in your browser
VIEW IN TELEGRAM
Sometimes it is beneficial to switch the project window to just a "tree view" with the One Column Layout.
#نکته #یونیتی
👉 @UnityEngine3D 👈
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍2
With Mathf.InverseLerp you can map the real time minutes to your ingame days.
Use the passed time to inverse lerp between 0f and your ingame length of a day to use the result in a lerp between 0f and 24f to get a float holding the time of day.
#نکته #یونیتی
👉 @UnityEngine3D 👈
Use the passed time to inverse lerp between 0f and your ingame length of a day to use the result in a lerp between 0f and 24f to get a float holding the time of day.
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍1
You can create your own packages for your projects.
You need an entry in your manifest.json which is located in your Packages folder.
You also need a package.json file in the folder that holds your code.
#نکته #یونیتی
👉 @UnityEngine3D 👈
You need an entry in your manifest.json which is located in your Packages folder.
You also need a package.json file in the folder that holds your code.
#نکته #یونیتی
👉 @UnityEngine3D 👈
👍1
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