Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to focus on gameobject from custom editor?

Discussion in 'Editor & General Support' started by alex_hajdu, Feb 28, 2015.

  1. alex_hajdu

    alex_hajdu

    Joined:
    Nov 10, 2013
    Posts:
    32
    I know how to make gameobject selected. But please how to do I make it also focused like after pressing "F" or double clicking on a gameobject ?


    Code (CSharp):
    1.  
    2. //MyCustomEditor.cs
    3. void FindCam ()
    4.     {
    5.         Selection.activeGameObject = Camera.main.gameObject;
    6.     }
     
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
  3. alex_hajdu

    alex_hajdu

    Joined:
    Nov 10, 2013
    Posts:
    32
  4. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Finding the right words to search for is not so easy, so no problem asking :)