Makes a script execute in edit mode.
// Make the script also execute in edit mode. @script ExecuteInEditMode()// Just a simple script that looks at the target transform. var target : Transform; function Update () { if (target) transform.LookAt(target); }
using UnityEngine; using System.Collections; [ExecuteInEditMode] public class Example : MonoBehaviour { public Transform target; void Update() { if (target) transform.LookAt(target); } }
import UnityEngine import System.Collections [ExecuteInEditMode] public class Example(MonoBehaviour): public target as Transform def Update() as void: if target: transform.LookAt(target)