UnityEngine.Cursor.SetCursor C# (CSharp) Method

SetCursor() private static method

private static SetCursor ( Texture2D texture, CursorMode cursorMode ) : void
texture Texture2D
cursorMode CursorMode
return void
        private static void SetCursor(Texture2D texture, CursorMode cursorMode)
        {
            SetCursor(texture, Vector2.zero, cursorMode);
        }

Same methods

Cursor::SetCursor ( Texture2D texture, Vector2 hotspot, CursorMode cursorMode ) : void

Usage Example

コード例 #1
0
ファイル: GameManager.cs プロジェクト: SinanEmiroglu/RM-Game
    public void GoToRoom(GameObject destination)
    {
        // Set and activate the destination room
        roomTarget = destination;
        roomTarget.SetActive(true);

        player.transform.position = roomTarget.transform.position;
        RoomData targetRoomData = roomTarget.GetComponent <RoomData>();

        if (targetRoomData.playerCanTurn)
        {
            player.GetComponent <PlayerMovement>().turnAngle = targetRoomData.allowedTurnAngle;
            triggerTurnLeft.SetActive(true);
            triggerTurnRight.SetActive(true);
        }
        else
        {
            player.GetComponent <PlayerMovement>().canTurn = false;
            triggerTurnLeft.SetActive(false);
            triggerTurnRight.SetActive(false);
        }

        // Deactivate the previous room the player was in and set the destination as the new current room
        if (roomCurrent != null)
        {
            roomCurrent.SetActive(false);
            roomCurrent = roomTarget;
        }
        roomTarget = null;

        // Return cursor to default image after clicking door
        Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
        print("Entered " + roomCurrent.name);
    }
All Usage Examples Of UnityEngine.Cursor::SetCursor