Exemple #1
0
        public CursorManager(IList <CursorMapping> cursors)
        {
            foreach (CursorMapping cursor in cursors)
            {
                _cursors.Add(cursor.type, cursor);
            }

            if (_cursors.TryGetValue(CursorType.None, out CursorMapping noneCursor))
            {
                _default = noneCursor;
            }
            else
            {
                _default = new CursorMapping();
            }

            SetCursor(CursorType.None);
        }
        private void SetCursor(CursorType type)
        {
            CursorMapping mapping = GetCursorMapping(type);

            Cursor.SetCursor(mapping.texture, mapping.hotspot, CursorMode.Auto);
        }