Search Unity

SetCursor Does not work during Scene view?

Discussion in 'Editor & General Support' started by Owchzzz, Feb 1, 2015.

  1. Owchzzz

    Owchzzz

    Joined:
    Jan 26, 2015
    Posts:
    13
    hi Guys.

    I have this code on my OnInspectorGUI

    Code (CSharp):
    1. if (GUILayout.Button(croppedTexture,GUILayout.Width(sr.sprite.rect.width),GUILayout.Height(sr.sprite.rect.height)))
    2.             {
    3.                 LevelDesign.ActiveGameTile = LevelDesign.GameTiles[x].gameObject;
    4.                 //Replace the 'cursorTexture' with the cursor  
    5.                 Cursor.SetCursor(croppedTexture, Vector2.zero, CursorMode.Auto);
    6.                 Debug.Log("Custom cursor has been set.");
    7.                 //Set the ccEnabled variable to true
    8.                 Debug.Log("Active Game Tile: " + LevelDesign.ActiveGameTile);
    9.                
    10.             }
    But it doesn't seem to work.

    Take note that the GUI Button Shows and Debug Log Does show "Custom cursor has been set" Without any warnings or errors.


    anybody have input maybe?
     
  2. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Looking for the answer to this too... :(