예제 #1
0
 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> ();
             }
         }
     }
 }
예제 #2
0
 public void Init()
 {
     if (raycastCamera == null)
     {
         raycastCamera = HighlightManager.GetCamera();
     }
     if (triggerMode == TriggerMode.RaycastOnThisObjectAndChildren)
     {
         colliders = GetComponentsInChildren <Collider> ();
     }
 }
예제 #3
0
        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;
        }