void Start() { if (triggerMode == TriggerMode.RaycastOnThisObjectAndChildren) { if (raycastCamera == null) { raycastCamera = HighlightManager.GetCamera(); if (raycastCamera == null) { Debug.LogError("Highlight Trigger on " + gameObject.name + ": no camera found!"); } } if (colliders != null && colliders.Length > 0) { hits = new RaycastHit[MAX_RAYCAST_HITS]; StartCoroutine(DoRayCast()); } } else { Collider collider = GetComponent <Collider> (); if (collider == null) { if (GetComponent <MeshFilter> () != null) { gameObject.AddComponent <MeshCollider> (); } } } }
public void Init() { if (raycastCamera == null) { raycastCamera = HighlightManager.GetCamera(); } if (triggerMode == TriggerMode.RaycastOnThisObjectAndChildren) { colliders = GetComponentsInChildren <Collider> (); } }
static void CreateManager(MenuCommand menuCommand) { HighlightManager manager = FindObjectOfType <HighlightManager> (); if (manager == null) { GameObject managerGO = new GameObject("HighlightPlusManager"); manager = managerGO.AddComponent <HighlightManager> (); // Register root object for undo. Undo.RegisterCreatedObjectUndo(manager, "Create Highlight Plus Manager"); } Selection.activeObject = manager; }