void OnEnable()
 {
     trigger = (TSEventTrigger)target;
     manager = GameObject.FindObjectOfType <TSMainManager>();
     EditorApplication.update += CheckLanes;
     collider = trigger.GetComponentInChildren <Collider>();
 }
Example #2
0
 void OnEnable()
 {
     trigger = (TSEventTrigger)target;
     trigger.spawnCarOnStartingPoint = true;
     EditorUtility.SetDirty(trigger);
     manager  = GameObject.FindObjectOfType <TSMainManager>();
     collider = trigger.GetComponentInChildren <Collider>();
     EditorApplication.update += CheckLanes;
 }
 public override void OnInspectorGUI()
 {
     collider = trigger.GetComponentInChildren <Collider>();
     EditorGUI.BeginChangeCheck();
     base.OnInspectorGUI();
     if (EditorGUI.EndChangeCheck())
     {
         EditorUtility.SetDirty(trigger);
     }
     if (collider == null)
     {
         EditorGUILayout.HelpBox("Please add a collider (trigger) to this Game Object!", MessageType.Warning);
     }
     if (collider != null && !collider.isTrigger)
     {
         EditorGUILayout.HelpBox("Please make your colliders attached to this game object be triggers!", MessageType.Warning);
     }
 }