GameObject[] MyEnemies = GameObject.FindGameObjectsWithTag(“Enemy”);
Also, the text data can be generated and parsed by tools, making it possible to create and analyze scenes automatically. Reference
Gamma color space and bloom are related to graphics. Depth of field is related to objects bluring when at a certain distance from the camera.
Use the Aim, Body, and Noise properties to specify how the Virtual Camera animates position, rotation, and other properties. The Virtual Camera applies these settings to the Unity Camera when Cinemachine Brain or Timeline transfers control of the Unity camera to the Virtual Camera. Reference
The Microphone class saves captured audio as an audio clip asset, which may then be stored as a OGG file. Reference
Unity’s default units are in meters (Unreal Engine too). If you keep this in mind and model with your units alined to meters, the lighting system will work minimal artifacting. Reference
Every time an element on a canvas is updated, the whole canvas is redrawn. If elements are never being updated, keeping them on a single canvas is ideal. Reference
[Space(20)]
Public string PlayerName;
This is a great way to customize your inspector without writing a new inspector script for it. Reference
OnStateMachineEnter()
and OnStateMachineExit()
are the methods of the StateMachineBehavior class that handle this. AnimatorClipInfo displays information about the current clip being played, AnimatiorUtility deals with transform hierarchy, and AnimationInfo was removed in version 5.0.
Reference
public Animator avatar;
public Transform lookAtObj;
void OnAnimatorIK(int layerIndex)
{
avatar.SetLookAtPosition(lookAtObj).position;
avatar.SetLookAtWeight(If);
}
When you use photogrammetry to scan in models from the real world, and bring in those models into Unity (or any renderer), you will notice that the lighting information is baked into the texture. You can remove the baked in lighting information with various tools online, but even Unity themeless wrote a custom tool for just this; check it out!
Simplfying the math: Unity uses Quaternions internally to avoid Gimbal lock. The Euler XYZ (Pitch, Yaw, and Roll) axises can lock up when two axies are aligned. Quaternion.Euler converts the Euler number provided to the internally used Quarternion, to prevent this problem. Reference
The object obj is destroyed immediately after the current Update loop, or t seconds from now if a time is specified. Reference
Audio attenuation is about energy loss, commonly refered to as “gain”. ParamEQ allows you to change the frequency of the audio - “pitch”, with no C# support. Audio Mixer groups do allow you to control audio effects, but not through C#. Official Unity Tutorial:
Mip Maps are a technique that improves image quality and reduces rendering speed, at the cost of storage space, by including smaller copies of the image in the same file. Animation events allow you to call functions at points in the timeline. Reference
The PlayableDirector component stores the link between a Timeline instance and a Timeline Asset. Reference
EventSystem is not a timeline feature, neither are packets. Timeline signals are a subfeature of the markers, markers can directly initiate code, while a signal can only send the signal to a reciver.
public class Health : MonoBehavior
{
private float HealthPoints = 100f;
public float GetHealth()
{
return HealthPoints;
}
public void SetHealth(float Change)
{
HealthPoints += Change;
if (HealthPoints <= 0)
Destroy(gameObject);
}
}
public class Health : MonoBehavior
{
public UnityEvent OnHealthChanged;
private float HealthPoints = 100f;
public void SetHealth(float Change)
{
HealthPoints += Change;
OnHealthChanged.Invoke();
}
public void Die()
{
Destroy(gameObject);
}
}
public class Health : MonoBehavior
{
public float HealthPoints
{
get { return _healthpoints; }
set
{
_healthpoints = value;
if(_healthpoints <= 0 )
{
Destroy(gameObjects);
}
}
}
private float _healthpoints = 100f;
}
public class Health : MonoBehaviour
{
public float HealthPoints = 100f;
private void Update()
{
if (HealthPoints <- 0)
Destroy(gameObject);
}
}
get
and set
are the clear indicators that a C# property is being used.
Reference