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 blurring 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 an OGG file. Reference
ReferenceUnity’s default units are in meters (Unreal Engine too). If you keep this in mind and model with your units aligned to meters, the lighting system will work with minimal artifacts.
OnTriggerEnter
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.
[Space(20)]
Public string PlayerName;
Reference 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.
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
ReferenceThe object obj is destroyed immediately after the current Update loop, or t seconds from now if a time is specified.
Official Unity Tutorial: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#.
ReferenceMip 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.
ReferenceThe PlayableDirector component stores the link between a Timeline instance and a Timeline Asset.
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
MonoBehaviour
Update
function is never called automatically while an object is deactivatedReset
method of MonoBehaviour
invoked automatically?ReferenceReset
is called when the user hits the Reset button in the Inspector’s context menu or when adding the component the first time. This function is only called in editor mode.
ExecuteAlways
makes instances of a script always execute, both as part of Play Mode and when editing. By default, MonoBehaviours are only executed in Play Mode and only if they are on GameObjects in the main stage containing the user Scenes. By adding this attribute, any instance of the MonoBehaviour will have its callback functions executed at all times.
[RunInEditor]
! It looks similar to MonoBehaviour.runInEditMode
and [ExecuteInEditMode]
both of which are legit but not mentioned as possible answers.IsPointerOverGameObject
static function of the EventSystem
class is useful for creating which behaviour?c# transform.localRotation *= Quaternion.Euler(0f, RotSpeed * Time.deltaTime, 0f);
c# transform.Rotate(Vector3.right, RotSpeed * Time.deltaTime);
c# transform.RotateAround(Vector3.up, RotSpeed * Time.deltaTime);
c# transform.SetParent(null);
Observation
: I tested it in Unity itself and pressing it activated the rotate, scale and transform function, in the documentation (unity 2018.2) it says that it is a unified one, in the documentation of the most recent unity (2022.2) I did not find anything different