You can specify the RequireComponent attribute on a class that inherits from MonoBehavior and Unity will add the specified component if it is not already present when you add the script to the game object.

[RequireComponent(typeof(RigidBody))]
public class SomeBehaviorScript : MonoBehaviour
{
}

If you are generating meshes procedurally via scripting you can optimize that mesh for drawing by using MeshUtility.Optimize.


You can use editor scripts to specify additional DEFINE directives for conditional compilation by using the EditorUserBuildSettings.activeScriptCompilationDefines property.


If you need your editor script to support drag and drop functionality you can use the methods provided in the DragAndDrop class.


If you need to know when the unity editor is changing play mode states you can hook into the EditorApplication.playmodeStateChanged callback.


Using EditorApplication.isPlaying & EditorApplication.isPaused you can control when you want to run or pause your game in the unity editor using scripting.


Unity provides access to the users microphone via the Microphone class.


Unity provides support for location awareness such as  longitude, latitude, and altitude in the LocationService class.


Unity provides built in support for various social platforms including support for custom implementations through the Social class.


If the device supports it you can use the Gyroscope class to get gyroscopic information about the orientation and acceleration  of the device.


Created by: X

Just another personal website in this crazy online world

Name of author Dean Lunz (aka Created by: X)
Computer programming nerd, and tech geek.
About Me -- Resume